npm - EPERM mkdir: operation not permitted on Windows - javascript

I am using node js 11.13.0 and npm above 6.0 by which I am trying to setup react js app in Windows by following command:
npx create-react-app new-app
and the output is coming as :
Error: EPERM: operation not permitted, mkdir 'C:\Users\Talha'
TypeError: Cannot read property 'loaded' of undefined
at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach ()
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined
at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
at process.emit (events.js:193:13)
at process._fatalException (internal/process/execution.js:123:25)
Install for create-react-app#latest failed with code 7
I don't find a way to figure out the solution.

There are two reasons why this might happen.
You are not running in an elevated cmd prompt.
You have spaces in your username or path npm is looking for cache. For eg. "c:\Users\Fname Lastname...."
For the first one you can try running npx create-react-app newapp in an elevated cmd prompt. (Launching cmd as admin)
For the second one you would have to replace the username on the path for npm config that has spaces with the alternative username windows generates which you can get by using the cmd DIR /X if you are in the location. "c:\Users\". After getting the alternative name you then run
npm config set cache "C:\Users\Firstname~1\AppData\Roaming\npm-cache" --global
where Firstname~1 is the alternative name you got from the DIR /X command. You should now be able to run npx create-react-app new-app with no errors.
More information on this can be found here

December 2020
I had the same error. It seems to be because of the whitespace in the User's name. The simplest solution is to update npm to the latest version. Run npm install -g npm#7 and you should be able to run npx create-react-app new-app without issues.

https://github.com/zkat/npx/issues/209#issuecomment-450702301
npm install -g create-react-app
npx create-react-app

Installing the latest stable version of NPM worked for me:
npm install -g npm#latest

Related

Mumble Web - Problems on running the code and the demo app locally

I'm trying to create a web application using React JS that has a push-to-talk (PTT) feature on it.
One of the technologies that we will use is Mumble.
The demo https://voice.johni0702.de/?address=voice.johni0702.de&port=443/demo on this https://github.com/Johni0702/mumble-web repository is working fine.
I tried to run the repository on my local computer but got some different errors.
Installation Errors
I cloned and tried to install all of the libraries on the root folder of the repository using the npm install command on my local computer with Windows OS and Node JS v16 but I got this error below.
verbose stack Error: command failed
verbose stack at ChildProcess.<anonymous> (C:\Users\LENOVO\AppData\Roaming\nvm\v16.18.0\node_modules\npm\node_modules\#npmcli\promise-spawn\lib\index.js:63:27)
verbose stack at ChildProcess.emit (node:events:513:28)
verbose stack at maybeClose (node:internal/child_process:1100:16)
verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
verbose pkgid mumble-client-websocket#1.0.0
verbose cwd C:\Users\LENOVO\AppData\Local\npm-cache\_cacache\tmp\git-cloneZtPlJ2
verbose Windows_NT 10.0.22621
verbose node v16.18.0
verbose npm v8.19.2
error code 1
error path C:\Users\LENOVO\AppData\Local\npm-cache\_cacache\tmp\git-cloneZtPlJ2
error command failed
error command C:\WINDOWS\system32\cmd.exe /d /s /c npm run compile
verbose exit 1
timing npm Completed in 8638ms
verbose code 1
Then I switched the Node JS version using the NVM from v16 to v14.
I tried to install all of the libraries on the repository using the npm install command again but then got another different error.
verbose stack Error: mumble-web#0.5.1 prepare: `rm -rf dist && npm run build`
verbose stack Exit status 1
verbose stack at EventEmitter.<anonymous> (C:\Users\LENOVO\AppData\Roaming\nvm\v14.21.2\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
verbose stack at EventEmitter.emit (events.js:400:28)
verbose stack at ChildProcess.<anonymous> (C:\Users\LENOVO\AppData\Roaming\nvm\v14.21.2\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
verbose stack at ChildProcess.emit (events.js:400:28)
verbose stack at maybeClose (internal/child_process.js:1088:16)
verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
verbose pkgid mumble-web#0.5.1
verbose cwd D:\A.ing\Works\Others\Lacak-and-Valid\Exercises\React-Js\mumble-web-2
verbose Windows_NT 10.0.22621
verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
verbose node v14.21.2
verbose npm v6.14.17
error code ELIFECYCLE
error errno 1
error mumble-web#0.5.1 prepare: `rm -rf dist && npm run build`
error Exit status 1
error Failed at the mumble-web#0.5.1 prepare script.
error This is probably not a problem with npm. There is likely additional logging output above.
verbose exit [ 1, true ]
I tried to delete the "prepare": "rm -rf dist && npm run build", code (line 45) on the package.json file.
I didn't know whether deleting the code would have an impact on running the app later or not.
I also searched on the internet and found this answer https://stackoverflow.com/a/62744648/8339172 to clear the npm cache, regenerate the package-lock.json file, and delete the node_modules folder.
I did all of them then I ran the "npm install" command again.
This time, there was no error.
Runtime Errors
Continuing the previous section, I tried to run the root of the repository by running the npm run watch command.
I didn't know whether this was correct or not because I usually enter the npm start command to run a React JS locally.
I didn't see any port configured on the package.json file so I opened the localhost:8080 address on my browser.
Unfortunately, there was nothing there. The browser said This site can’t be reached. localhost refused to connect.
The App Folder
Continuing the previous section, I tried to run the index.html file on the app folder by double-clicking on the file.
It seemed that the app crashed because I saw there was an error on the browser console as seen in this screenshot below.
Here is the error message:
Uncaught SyntaxError: Cannot use import statement outside a module (at index.js:1:1)
Questions
I want to learn how to create the demo (https://voice.johni0702.de/?address=voice.johni0702.de&port=443/demo) on the repository https://github.com/Johni0702/mumble-web. My questions are:
Which one is the source code of the demo app? Is it from the root folder of the repository or the app folder?
Continuing the first question, how to install all of the required dependencies for the demo app locally?
Continuing the first and second questions, how to run the demo app locally?
Environment
OS: Windows 11
Node: 14.21.2, 16.18.0, and 18.13.0 (switchable)
Finally, I could run the app (root level) on my computer.
From the installation error section, we could see that this error verbose stack Error: mumble-web#0.5.1 prepare: `rm -rf dist && npm run build` happened when a Windows-based computer tried to run a Unix-based command. There is no rm command on the Windows computer.
So I tried to install the WSL on my Windows computer https://techcommunity.microsoft.com/t5/windows-11/how-to-install-the-linux-windows-subsystem-in-windows-11/td-p/2701207.
After strugling with the WSL installation, I could run the npm install command on the app and no error message appeared.
But then I didn't know how to run the app. Fortunately, we found another similar repository that has the start script here https://github.com/Theofilos-Chamalis/mumble-web. Using the npm install and npm start, I finally could run a mumble implementation the frontend app.
Note: the app from the https://github.com/Theofilos-Chamalis/mumble-web was not updated like the https://github.com/Johni0702/mumble-web one but I think that's another issue from this question.

Errors when installing WebdriverIo

Installing wdio packages:
- #wdio/local-runner
- #wdio/mocha-framework
- #wdio/spec-reporter
- wdio-chromedriver-service
- chromedriver
npm WARN deprecated #types/easy-table#1.2.0: This is a stub types definition. easy-table provides its own type definitions, so you do not need this installed.
added 115 packages, and audited 459 packages in 13s
92 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Packages installed successfully, creating configuration file...
Config file installed successfully, creating test files...
Configuration file was created successfully!
To run your tests, execute:
$ npx wdio run wdio.conf.js
Adding "wdio" script to package.json.
Unknown command: "set-script"
Did you mean this?
npm run-script # Run arbitrary package scripts
To see a list of supported npm commands, run:
npm help
file:///C:/Users/User/AppData/Local/npm-cache/_npx/46b5fbaa5aefb2df/node_modules/create-wdio/build/utils.js:19
return reject(new Error((error && error.message) ||
^
Error: Error calling: npm set-script wdio wdio run wdio.conf.js
at ChildProcess.<anonymous> (file:///C:/Users/User/AppData/Local/npm-cache/_npx/46b5fbaa5aefb2df/node_modules/create-wdio/build/utils.js:19:31)
at ChildProcess.emit (node:events:513:28)
at cp.emit (C:\Users\User\AppData\Local\npm-cache\_npx\46b5fbaa5aefb2df\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)
Node.js v18.12.1
npm ERR! code 1
npm ERR! path C:\Users\User\Downloads\webdriverio
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c create-wdio .
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2022-11-26T14_16_31_932Z-debug-0.log
I don't understand why did I get such errors? Now I'll try to describe you detailed what I did I made several steps:
Download the latest node.js version via https://nodejs.org/en/download/
I set NODE_HOME in system variables
Created empty folder
Opened empty folder in command prompt, (cd 'path to this empty folder')
Wrote 'npm init wdio .' into the command prompt
Then I just chose the default options
I was waiting and such errors appeared
I tried to update npm to the latest version. It doesn't help.

how to solve npm start error in windows 10? [duplicate]

I'm trying to learn react, so I have this sample code for the full-stack react voting app, and I am trying to get it to work but after running npm install followed by npm start I receive the following error when I run npm start can anyone help me with this issue:
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "server"
npm ERR! node v7.5.0
npm ERR! npm v4.3.0
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! voting_app#1.1.0 server: `live-server --public --
host=localhost --port=3000 --middleware=./disable-browser-cache.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the voting_app#1.1.0 server script 'live-server --
public --host=localhost --port=3000 --middleware=./disable-browser-
cache.js'.
npm ERR! Make sure you have the latest version of node.js and npm
installed.
npm ERR! If you do, this is most likely a problem with the voting_app
package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! live-server --public --host=localhost --port=3000 --
middleware=./disable-browser-cache.js
npm ERR! You can get information on how to open an issue for this
project with:
npm ERR! npm bugs voting_app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls voting_app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_581Z-
debug.log
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.5.0
npm ERR! npm v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! voting_app#1.1.0 start: `npm run server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the voting_app#1.1.0 start script 'npm run server'.
npm ERR! Make sure you have the latest version of node.js and npm
installed.
npm ERR! If you do, this is most likely a problem with the voting_app
package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run server
npm ERR! You can get information on how to open an issue for this
project with:
npm ERR! npm bugs voting_app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls voting_app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_655Z-
debug.log
Here is my package.json:
{
"name": "voting_app",
"version": "1.1.0",
"author": "Fullstack.io",
"scripts": {
"go": "open http://localhost:3000; npm run server",
"e2e": "nightwatch",
"test": "./node_modules/.bin/concurrently -k 'npm run server' 'npm
run e2e'",
"start": "npm run server",
"server": "live-server public --host=localhost --port=3000 --
middleware=./disable-browser-cache.js"
},
"private": true,
"devDependencies": {
"concurrently": "2.2.0",
"live-server": "git://github.com/acco/live-server.git"
},
"dependencies": {
"semantic-ui": "git://github.com/Semantic-Org/Semantic-
UI.git#27d58a01793b66318478fbc5b6676804d22d065d"
}
}
And finally my log file:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm#4.3.0
3 info using node#v7.5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle voting_app#1.1.0~prestart: voting_app#1.1.0
6 silly lifecycle voting_app#1.1.0~prestart: no script for prestart, continuing
7 info lifecycle voting_app#1.1.0~start: voting_app#1.1.0
8 verbose lifecycle voting_app#1.1.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle voting_app#1.1.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/ItsMeMrLi/.rvm/gems/ruby-2.3.1/bin:/Users/ItsMeMrLi/.rvm/gems/ruby-2.3.1#global/bin:/Users/ItsMeMrLi/.rvm/rubies/ruby-2.3.1/bin:/Users/ItsMeMrLi/.cargo/bin:/usr/local/Cellar/smlnj/110.74/libexec/bin:/usr/local/bin:/Users/ItsMeMrLi/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Downloads/geckodriver:/usr/local/bin:/Users/ItsMeMrLi/.rvm/bin
10 verbose lifecycle voting_app#1.1.0~start: CWD: /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app
11 silly lifecycle voting_app#1.1.0~start: Args: [ '-c', 'npm run server' ]
12 silly lifecycle voting_app#1.1.0~start: Returned: code: 1 signal: null
13 info lifecycle voting_app#1.1.0~start: Failed to exec start script
14 verbose stack Error: voting_app#1.1.0 start: `npm run server`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:192:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:192:7)
14 verbose stack at maybeClose (internal/child_process.js:890:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid voting_app#1.1.0
16 verbose cwd /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app
17 error Darwin 16.4.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.5.0
20 error npm v4.3.0
21 error code ELIFECYCLE
22 error errno 1
23 error voting_app#1.1.0 start: `npm run server`
23 error Exit status 1
24 error Failed at the voting_app#1.1.0 start script 'npm run server'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the voting_app package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error npm run server
24 error You can get information on how to open an issue for this project with:
24 error npm bugs voting_app
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls voting_app
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]
Step 1: $ npm cache clean --force
Step 2: Delete node_modules by $ rm -rf node_modules (rmdir /S /Q node_modules in windows) folder or delete it manually by going into the directory and right-click > delete / move to trash. If you are not updating your packages you can delete the package-lock.json file too.
Step 3: npm install
To start again,
$ npm start
This worked for me. Hopes it works for you too.
PS: Still if it is there, kindly check the error it is displaying in red and act accordingly. This error is specific to node.js environment.
Cleaning Cache and Node_module are not enough.
Follow this steps:
npm cache clean --force
delete node_modules folder
delete package-lock.json file
npm install
It works for me like this.
I resolve this error running following code
npm cache clean
then delete node_modules directory from my project structure manually or with following command
rm -rf node_modules
After That install dependencies again using
npm install
first i ran:
npm run clean
(even though it came with errors)
Then i deleted the node_modules folder and ran
npm install
This seems to have solved the problem.
I was getting similar error messages on a 16.04 Ubuntu instance with DigitalOcean while running npm run build on an app made with create-react-app (link). I upgraded the instance from 512MB RAM to 1GB ($5/mo to $10/mo) and then the script was able to run.
I post this here to point out that you may get this error due to resource limitations, which I didn't really see explained elsewhere on issue pages and SO answers. And nothing I saw in the error logs pointed me in this direction.
Change access in node_modules directory
chmod -R a+rwx ./node_modules
This solution is for Windows users.
You can open the node.js installer and give the installer some time to compute space requirements and then click next and click remove. This will remove node.js from your computer and again reopen the installer and install it in this path - C:\Windows\System32
or
Cleaning Cache and Node_module will work.
Follow this steps:
npm cache clean --force
delete node_modules folder
delete package-lock.json file
npm install
Faced this exact problem,
for me it worked by deleting package-lock.json and re-running npm install
If that doesn't resolve it try
delete package-lock.json
npm cache clean --force
npm install
npm start
Delete node_modules and package-lock.json, and then run npm install. It worked perfectly here(run command below inside project root):
rm -rf node_modules && rm ./package-lock.json && npm install
I was getting this npm ERR! code ELIFECYCLE error while running a build. Clearing the cache and removing the package-lock.json files did not fix it.
In my case there was an Angular build running on a Docker image that was causing this. The root cause turned out to be running the build on Docker in MacOS, which runs the Docker inside a Linux VM, and has by default 2GB memory allocated.
Giving Docker more memory fixed this issue for me. Have to say, the error message could have been quite a bit more clear..
A helpful answer for me was Call retries were exceeded exception while ng build
workaround: Remove the lock file.
rm .\package-lock.json
source: https://github.com/mapbox/node-pre-gyp/issues/298 (floriantraber)
React Application: For me the issue was that after running npm install had some errors.
I've went with the recommendation npm audit fix. This operation broke my package.json and package-lock.json (changed version of packages and and structure of .json).
THE FIX WAS:
Delete node_modules
Run npm install
npm start
Hope this will be helpfull for someone.
npm install --unsafe-perm
worked for me. See https://docs.npmjs.com/. The --unsafe-perm parameter lets you run the scripts from the package instalation as root. The problem in my case was that some depandencies failed to install.
This solution fixed the error in Win10.
Please install globally npm install -g node-pre-gyp
i tried to solve this problem with this way
rm -rf node_modules && rm ./package-lock.json && npm install
But for me its not work.
I just restart my machine and its working perfectly.
Am Linux user ,Machine HP.
I recommend you update your node version to the latest node version recommended by your application or for short update your node version. I encountered this same problem using node version 11.1 but my application was recommending atleast version 10.x.x or 12.x.x
I tried all the suggested reply on this thread but non seemed to work for me untill only when i updated my node version to the recommended latest version .i.e. version 12.16.3 then my application ran.
I just wanted to do run npm run dist to apply some changes for SCSS files, but after hours of suffering, here's what worked for me:
npm cache clean --force
delete node_modules folder
delete package-lock.json file
sudo npm install npm#latest -g this will upgrade npm to latest version
npm audit fix --force
npm upgrade --force
npm install
After these I could finally compile SCSS files successfully with npm run dist.
Check for port availability as well if you encounter below message :
Error: listen EACCES 127.0.0.1:8080
at Object._errnoException (util.js:999:13)
at _exceptionWithHostPort (util.js:1020:20)
at Server.setupListenHandle [as _listen2] (net.js:1362:19)
at listenInCluster (net.js:1420:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1535:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:102:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
A possibly unexpected cause: you use Create React App with some warnings left unfixed, and the project fails on CI (e.g. GitLab CI/CD):
Treating warnings as errors because process.env.CI = true.
[ ... some warnings here ...]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
Solution: fix yo' warnings!
Alternative: use CI=false npm run build
See CRA issue #3657
(Ashamed to admit that it just happened to me; did not see it until a colleague pointed it out. Thanks Pascal!)
I'm using ubuntu 18.04 LTS release and I faced the same problem I tried to clean cache as above suggestions but it didn't work for me. However, I found another solution.
echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
npm start
I run this command and it started to work
In my case, I actually ran into this error "code ELIFECYCLE" in a Jenkins job. I tried to clean npm cache but it didn't work and also checked the memory of the Jenkins build server which looks okay. Then, I found the compiling of the react project actually failed in Jenkins but not in my local or when manually running the build on the Jenkins build server, and Jenkins also mentioned "Treating warnings as errors because process.env.CI = true". It looks like the warnings in my project cause the error on Jenkins. Therefore, I changed CI to true in the Jenkins job for now. That actually fixed the build error of Jenkins before I cleared those warnings.
Try to reinstall the cli package globally. In my case, I was trying to test a Vue.js tutorial when I get the same error message. The other thing I did was run the vue command again but this time using webpack-simple and that is why I am not sure wich one solved the problem but now it is working.
The port is probably being used by another application, try listing and see if it's your application:
lsof -i:8080
You can kill the process of this port:
lsof -ti:8080 | xargs kill
I've been bothered by this issue for a long time. For me, the version of node was the problem.
My npm and node were 6.1.0 and 8.11.3, respectively. However, I didn't realize that I had updated my node accidentally to 12.*.*.
It then began to install GCX stuff whenever npm i, which was unnecessary before.
I downgraded my node to 8 and it worked!
Its weird but it works for me
Go to
control panel -->System and Security--> System --> Advanced System
Security--> Environment Variables
In Environment Variable popup you will edit the user variable PATH and add "C:\Windows\System32" value as semicolon separated to the existing value.
Not but not least restart the Machine.
I did follow steps, it works:
1.
npm cache clean --force
remove the package-lock.json file
restart my WebStorm
Usually killall node command fixes mine.
Resolved like this:
# chown -R <user>: node_modules
Make sure to use the latest npm version while installing packages using npm.
While installing JavaScript, mention the latest version of NodeJS. For example, while installing JavaScript using devtools, use the below code:
devtools i --javascript nodejs:10.15.1
This will download and install the mentioned NodeJS version. This worked for me.
I was issuing the npm start command with the folder of the project opened at Sublime Text. Closing ST and restarting the server did the work for me.

TypeError: Cannot read property 'config' of null

After copied my Angular project from my local computer to my Linux server, I tried to run the project using ng serve and it didn't work. Instead it opened a new file in an editor in the console.
Then I researched and came up with npm start. However, that also not working. Gives me the following error.
Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
at Class.run (/var/www/html/node1/social2/client/node_modules/angular-cli/tasks/serve.js:22:61)
at /var/www/html/node1/social2/client/node_modules/angular-cli/commands/serve.run.js:22:22
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client#0.0.0 start: `start http://xxx.xx.xx.xx:4200 & ng serve -port 4200`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client#0.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! /root/.npm/_logs/2018-01-23T18_49_07_743Z-debug.log
And I have the .angular-cli.json file also there. It's not missing.
What could be the reason for this ? And any solution.?
You may have to install angular cli on your linux server if you want to run it this way.
npm install #angular/cli -g
However, you may want to build your project for production if you want to serve it. Build it locally and push the built 'dist' folder to your server:
npm run ng build -prod
Try this
npm install -g #angular/cli

Issues deploying meteor app to modulus

Following something similar to this... http://stuart-85933.onmodulus.net/ and that exact one. Tried a bunch of things for an hour and I'm dying. Help please!
Thanks.
"Unable to connect to any application instances."
Here is my logs on modulus website
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ../../main
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs meteor-dev-bundle
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls meteor-dev-bundle
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /mnt/app/bundle/programs/server/npm-debug.log
Now using node v0.10.41 (npm v3.9.6)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start
> meteor-dev-bundle#0.0.0 start /mnt/app/bundle/programs/server
> node ../../main
assert.js:93
throw new assert.AssertionError({
^
AssertionError: "undefined" === "function"
at wrapPathFunction (/mnt/app/bundle/programs/server/mini-files.js:77:10)
at Object.<anonymous> (/mnt/app/bundle/programs/server/mini-files.js:108:24)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/mnt/app/bundle/programs/server/boot.js:9:13)
at Module._compile (module.js:456:26)
npm ERR! Linux 3.13.0-92-generic
npm ERR! argv "node" "/mnt/app/.modulus/nvm/v0.10.41/bin/npm" "start"
npm ERR! node v0.10.41
npm ERR! npm v3.9.6
npm ERR! code ELIFECYCLE
npm ERR! meteor-dev-bundle#0.0.0 start: `node ../../main`
npm ERR! Exit status 8
Modulus is currently working on adding compatibility for some of the newer Meteor releases i.e. Meteor 1.4. More information about this error can be found in the issues noted below. You can see updates on this issue here:meteor github issue, meteor build runtime, demeteorizer github issue
Edit: There is a workaround if you are still having trouble, but it is a little lengthy. This workaround should work for any new version of Meteor that comes out, even versions that aren't working with the Meteor runtime yet.
Make sure the app runs locally
Install any unresolved modules
i.e. if you get this message when running locally:
Unable to resolve some modules:
XYZ ...
If you notice problems related to these missing modules, consider running:
meteor npm install --save XYZ
Run demeteorizer
$ npm install demeteorizer -g
$ demeteorizer
Change directory to .demeteorized/bundle/programs/server/
$ cd .demeteorized/bundle/programs/server/
Run npm install in that directory
$ npm install
Edit the package.json in that directory after running 'npm install' and specify the correct node engine: i.e. node 4.4.7
Change directory to root of the bundle
$ cd ../../
Make sure you are in the root of 'bundle,' and then zip the contents
$ pwd
/exampleDirectory/yourProject/.demeteorized/bundle
Zip contents of bundle
$ zip -r -X myProject.zip ./
Move that zip to the root of your project directory (or a non hidden folder)
Go to your project dashboard at my.modulus.io
a. Stop your project
b. Change runtime to node.js in the
'administration' panel
c. Confirm you have MONGO_URL and ROOT_URL
specified in environment variables
d. Go back to 'home' of project
dashboard, and upload / deploy the zip

Categories