Error: Cannot find module '#angular/tsc-wrapped/src/tsc' ionicjs ionic view - npm

I get following error when try to compile ionic 3 app with ionic-view (www.ionicjs.com)
Error: Cannot find module '#angular/tsc-wrapped/src/tsc'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (/usr/src/app/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:7:13)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
npm info lifecycle MedMan#0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! MedMan#0.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the MedMan#0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/gitlab-runner/.npm/_logs/2017-09-25T14_14_22_583Z-debug.log
/snapshot.sh: line 32: [: missing `]'
npm run build failed
Make sure your project has a build script in the package.json
Failed to upload build to storage please retry your build.
Running after script...
$ clean-up
Cleaning up files...
Successful clean up
ERROR: Job failed: exit status 1
I work with following Versions:
"#angular/tsc-wrapped": "4.4.3",
"#ionic/cli-plugin-ionic-angular": "1.4.1"
"ionic": "3.12.0",
"rxjs": "^5.4.3",
"tslint": "^5.7.0",
"tslint-loader": "^3.5.3"
npm v 4.6.1
node v 8.5.0
None of the solutions at the web can solve this issue for me.

I guess this should fix it:
upgrade npm to the latest version (5.3.0), I personally stayed at 5.1.0 because there were issues with ionic and version 5.2.0 but I think it is fixed in the current version
rm -rf node_modules package-lock.json (on Windows: delete node_modules and package-lock.json manually)
npm install
If it still does not work you can try to manually install tsc-wrapped:
npm install --save-dev #angular/tsc-wrapped

Try this:
npm install npm#latest -g
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli#latest
npm install #angular/tsc-wrapped autoprefixer
https://github.com/angular/angular-cli/issues/3183#issuecomment-261740427
I additionally had to (but dont think this is only related to my case):
npm rebuild node-sass

Related

Unable to "npm install"

Please could I ask for help with the following:
I have cloned the Electron starter app like so:
git clone https://github.com/electron/electron-quick-start
And have it running.
I am working from the terminal window is VSCode.
I am using node version 6.13.4
Can type "npm start" and all is good, app runs fine.
Now, I want to use a certain package for working with zip files, so I try the following:
npm install decompress-zip
The result is ultimately an error, here's the output:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm install decompress-zip
> electron#16.0.5 postinstall C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\electron
> node install.js
RequestError: self signed certificate in certificate chain
at ClientRequest.<anonymous> (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:428:26)
at ClientRequest.emit (events.js:333:22)
at ClientRequest.origin.emit (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\#szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:321:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm WARN rollback Rolling back debug#2.6.9 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\extract-zip\node_modules'npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#16.0.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#16.0.5 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\105043131\AppData\Roaming\npm-cache\_logs\2022-01-05T11_15_47_499Z-debug.log
Now the build is broken. If try again "npm start" then I get:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm
start
electron-quick-start#1.0.0 start C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip
electron .
internal/modules/cjs/loader.js:984 throw err; ^
Error: Cannot find module 'C:\Work\Electron
Apps\electron-quick-start-added-fs-and-zip\node_modules\electron\cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
at Function.Module._load (internal/modules/cjs/loader.js:863:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } npm ERR! code ELIFECYCLE npm
ERR! errno 1 npm ERR! electron-quick-start#1.0.0 start: electron .
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
electron-quick-start#1.0.0 start script. npm ERR! This is probably not
a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\105043131\AppData\Roaming\npm-cache_logs\2022-01-05T11_18_31_473Z-debug.log
Makes no difference now if I run "npm uninstall decompress-zip", I still get the same error when I try "npm start".
This line from the above caught my eye:
npm ERR! Failed at the electron#16.0.5
If I start completely over an try installing another package instead like so:
npm install yauzl
I get similar errors including the line:
npm ERR! Failed at the electron#16.0.5 postinstall script.
I currently have electron 8.1.1 installed
Could it be that these packages require electron 16?
Or is it something else?
If it is the former, would anyone know of a solution for unzipping a disk file using an older version of electron?
Thanks for any help.
the best way is to update Node.js. Uninstall old version then go to https://nodejs.org/en/download/ and download LTC version

How do I remove error in installing ignite-cli?

I am a beginner in react native in ignite. By mistake I installed ignite-cli twice with this command:
npm install -g ignite-cli
Now it shows this error:
npm ERR! code EEXIST
npm ERR! path C:\Users\boidurja\AppData\Roaming\npm\node_modules\ignite-cli\bin\ignite
npm ERR! dest C:\Users\boidurja\AppData\Roaming\npm\ignite
npm ERR! EEXIST: file already exists, cmd shim
'C:\Users\boidurja\AppData\Roaming\npm\node_modules\ignite-cli\bin\ignite' ->
'C:\Users\boidurja\AppData\Roaming\npm\ignite'
npm ERR! File exists: C:\Users\boidurja\AppData\Roaming\npm\ignite
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\boidurja\AppData\Roaming\npm-cache\_logs\2020-03-21T04_32_24_707Z-debug.log
I can't create a new project. When I create a new project(ignite new myproject) it shows this error:
C:\Users\boidurja\AppData\Roaming\npm\node_modules\ignite\node_modules\root-path\index.js:20
throw new Error('cannot find any package.json file');
^
Error: cannot find any package.json file
at Object.<anonymous> (C:\Users\boidurja\AppData\Roaming\npm\node_modules\ignite\node_modules\root-
path\index.js:20:9)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Module._compile
(C:\Users\boidurja\AppData\Roaming\npm\node_modules\ignite\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Object.newLoader [as .js]
(C:\Users\boidurja\AppData\Roaming\npm\node_modules\ignite\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous>
(C:\Users\boidurja\AppData\Roaming\npm\node_modules\ignite\dist\ignite.js:36:40)
How do I remove these errors so that I will be able to create a new project?
First check if you have installed the latest version of node.
node -v
Then install Yarn (https://classic.yarnpkg.com/en/docs/install)
After that , type following commands
yarn global add ignite-cli
ignite new MyNewAppName

How do I duplicate a VueJS project?

When trying to simply duplicate a whole VueJS project using cp -r project clone_project, I get the following error when running npm run serve from the clone_projectdirectory:
> design#0.1.0 serve /Users/path_to_clone_project/clone_project
> vue-cli-service serve
internal/modules/cjs/loader.js:613
throw err;
^
Error: Cannot find module '../package.json'
Require stack:
- /Users/path_to_clone_project/clone_project/node_modules/.bin/vue-cli-service
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/Users/path_to_clone_project/clone_project/node_modules/.bin/vue-cli-service:5:25)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:824:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! design#0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the design#0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The original project was created using the Vue CLI tool. I don't understand the error since the package.jsonfile was copied as expected with the rest of the project.
Delete your node_modules folder and run npm install.
npm install will create node_modules folder and install all of the packages that are defined in package.json.
Then run npm run serve

ERROR Error: Cannot find module '#xtuc/long'

I am learning vueJs, I have installed my project using CLI and by project has successfully installed, the problem come when i need to run my project via terminal with a command npm run serve, below is the error that occur after running the command
$ npm run serve
> school#0.1.0 serve C:\Users\Mr chomvu\Documents\vueproject\school
> vue-cli-service serve
INFO Starting development server...
ERROR Error: Cannot find module '#xtuc/long'
Error: Cannot find module '#xtuc/long'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Mr
chomvu\Documents\vueproject\school\node_modules\#webassemblyjs\wast-
printer\lib\index.js:10:36)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! school#0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the school#0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Mr chomvu\AppData\Roaming\npm-cache\_logs\2019-
06-08T13_11_37_227Z-debug.log
I do expect after successfully compilation to have a local:
https://localhost:8080
I have attached the error image:
If you don't make any changes in project, just you trying to install and run your first vue.js app then follow this guide Creating a Project CLI, and everything will be fine.
Be sure you using the latest version of node & npm.
If you want to fix this project try remove node_modules and the package-lock.json file, and than run npm install

Error: Cannot find module 'browser-sync'

When am trying to start gulp serve
Its raise an error
module.js:338
throw err;
^
Error: Cannot find module 'browser-sync'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/home/sajad/p_projects/my-project/gulpfile.js:17:19)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
After that i tried sudo npm rm browser-sync && npm install browser-sync
its raise follwing error
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "browser-sync"
npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! file
/home/sajad/.npm/escape-html/1.0.2/package/package.json npm ERR! code
EJSONPARSE
npm ERR! Failed to parse json npm ERR! No data, empty input at 1:1 npm
ERR! npm ERR! ^ npm ERR! File:
/home/sajad/.npm/escape-html/1.0.2/package/package.json npm ERR!
Failed to parse package.json data. npm ERR! package.json must be
actual JSON, not just JavaScript. npm ERR! npm ERR! This is not a bug
in npm. npm ERR! Tell the package author to fix their package.json
file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! /home/sajad/p_projects/my-project/npm-debug.log
Guide me how to start gulp serve and how resolve these error
I also had a same problem, I was able to solve it by entering this.
npm i browser-sync --save
Check this link here: https://github.com/brawlins/react-webpack-php-starter/issues/1
I tried these steps. Its work for me.
Globally install gulp.
Next need to install the project’s local dependencies (that’s where it’s looking for browser-sync). To do that,
cd into the project directory and run npm install.
Then try gulp serve.
You can also try following lines
npm i browser-sync --save then
npm start
You can try a :
npm cache clean
as it looks like it's not related to your project but your npm files,
and then re run npm install
Are you behind a proxy? Because it happened once to me in a company, this specific node module wouldn't be installed because of the proxy. I had to install it without proxy to make it work. Just try on your phone or another network.