I'm working with node v11.5 and npm 6.4.1 on a flash drive E, on win 7, I'm trying to install the lastest netlify cli. Following https://cli.netlify.com/getting-started , I have:
$ npm install netlify-cli -g
npm ERR! code EINVAL
npm ERR! EINVAL: invalid argument, read
The error log shows pretty much the same thing:
12961 verbose stack Error: EINVAL: invalid argument, read
12961 verbose stack at E:\nodejs\node_modules\npm\node_modules\gentle-fs\lib\rm.js:245:7
12961 verbose stack at E:\nodejs\node_modules\npm\node_modules\gentle-fs\node_modules\iferr\index.js:13:50
12961 verbose stack at E:\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18
12961 verbose stack at FSReqCallback.oncomplete (fs.js:161:5)
12962 verbose cwd E:\myproj
12963 verbose Windows_NT 6.1.7601
12964 verbose argv "E:\\nodejs\\node.exe" "E:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "netlify-cli" "-g"
12965 verbose node v11.5.0
12966 verbose npm v6.4.1
12967 error code EINVAL
12968 error EINVAL: invalid argument, read
12969 verbose exit [ 1, true
How can I get this working?
Sometimes some issues happens with npm because of OS or some issue. Try using some other package manager say yarn.
yarn global add netlify-cli
Install yarn using the following command
npm install yarn -g
Related
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.
I'm running "npm install node-sass" from git-bash-cli in Windows 10 and getting a "'node' is not recognized as an internal or external command,
operable program or batch file." error.
I have been using this setup for years and the issues started when I upgraded node to 10.16.0
To prevent unnecessary replies:
All the questions I have seen simply say to add the path variable.
I have added Node to the PATH variable and tried a number of different ways of writing it. I ended up reinstalling Node.js and that does it automatically, so I just left it as that.
node runs from the command line, just not from scripts, like scripts in the package.json file.
I have tried reinstalling node 8.11.3, which is the version I was using before the problems started, but I get the same error. I am back to v 10.16.0 again.
Error code is as follows:
> node-sass#4.12.0 install C:\projects\true\true\website\truevue\node_modules\node-sass
> node scripts/install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.0.7 (node_modules\#nuxt\builder\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.12.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.12.0 install 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\Peter\AppData\Roaming\npm-cache\_logs\2019-07-24T23_41_06_896Z-debug.log
Here's the log when I run npm run dev on a Vue project I'm working on
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Peter\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using npm#6.10.2-next.1
3 info using node#v10.16.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle thisistrue.co#1.0.0~predev: thisistrue.co#1.0.0
6 info lifecycle thisistrue.co#1.0.0~dev: thisistrue.co#1.0.0
7 verbose lifecycle thisistrue.co#1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle thisistrue.co#1.0.0~dev: PATH: C:\Users\Peter\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\projects\true\true\website\truevue\node_modules\.bin
9 verbose lifecycle thisistrue.co#1.0.0~dev: CWD: C:\projects\true\true\website\truevue
10 silly lifecycle thisistrue.co#1.0.0~dev: Args: [ '/d /s /c',
10 silly lifecycle 'cross-env NODE_ENV=development nodemon server/index.js --watch server' ]
11 silly lifecycle thisistrue.co#1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle thisistrue.co#1.0.0~dev: Failed to exec dev script
13 verbose stack Error: thisistrue.co#1.0.0 dev: `cross-env NODE_ENV=development nodemon server/index.js --watch server`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Peter\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:317:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Peter\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid thisistrue.co#1.0.0
15 verbose cwd C:\projects\true\true\website\truevue
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Peter\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v10.16.0
19 verbose npm v6.10.2-next.1
20 error code ELIFECYCLE
21 error errno 1
22 error thisistrue.co#1.0.0 dev: `cross-env NODE_ENV=development nodemon server/index.js --watch server`
22 error Exit status 1
23 error Failed at the thisistrue.co#1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Finally found an answer to this.
All I ended up doing was running npm update -g and it fixed the issue
Thanks all who helped, hope this can help someone else
I think you must add the path of node.js to the system variable
First: open Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables
Second: in "User variables" or "System variables" find variable PATH and add node.js folder path as value.it is C:\Program Files\nodejs;If it doesn't exists, create it.
Third: Restart your computer.
12915 warn whisper-chat-example#1.0.0 No repository field.
12916 warn The package web3 is included as both a dev and production dependency.
12917 verbose type ProcessTerminatedError
12918 verbose stack ProcessTerminatedError: cancel after 1 retries!
12918 verbose stack at Farm.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js:87:25)
12918 verbose stack at Array.forEach (<anonymous>)
12918 verbose stack at Farm.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js:81:36)
12918 verbose stack at ontimeout (timers.js:427:11)
12918 verbose stack at tryOnTimeout (timers.js:289:5)
12918 verbose stack at listOnTimeout (timers.js:252:5)
12918 verbose stack at Timer.processTimers (timers.js:212:10)
12919 verbose cwd /Users/ishansrivastava/Desktop/blocks/Decentralized_Chat
12920 verbose Darwin 18.0.0
12921 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
12922 verbose node v10.1.0
12923 verbose npm v6.0.1
12924 error cancel after 1 retries!
12925 verbose exit [ 1, true ]
I don't understand what is wrong. How do I solve this? Is it something related with the line included as both a dev and production dependency?
While running npm run dev I get:
sh: cross-env: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! whisper-chat-example#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --hot`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the whisper-chat-example#1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
As the error says, you have the package defined in both dev and production dependencies.
If you need the package to be used in development only, you have to define it ONLY in dev dependencies.
If you need in in production, remove it from the devDependencies and define it in dependecies ONLY.
About the cross-env, you need to install it as global package with npm install cross-env -g. This way the command will be recognized and don't return an error.
Unfortunately, I'm having issues with installing react-native
I get this error while installing
Unexpected end of JSON input while parsing near '...0.0","acorn-globals":'
I think the problem is with something called jest, because but when I try to install only jest,
I get the same error, I don't know what jest is I'm just starting to learn react-native .
here is the log files :
393 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...0.0","acorn-globals":'
393 verbose stack at JSON.parse (<anonymous>)
393 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
393 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
393 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
394 verbose cwd D:\Dev\React-Native\Sektorian
395 verbose Windows_NT 10.0.16299
396 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "jest" "babel-jest" "babel-preset-react-native" "react-test-renderer#16.3.1" "--save-dev" "--save-exact"
What do yo think the problem is ?
It seems and error related to NPM, you could try to solve it in this way:
clear the cache for NPM npm cache clean.
delete node_modules
reinstall your dependencies using npm install.
I had this kind of error while trying create-react-app <project_name> .
For me, this worked:
npm cache clean --force
Then I uninstalled the required package:
sudo npm uninstall -g create-react-app
Then reinstalled with --save flag and this seemed to solve the problem:
sudo install -g create-react-app --save
Hope that helps! Happy coding!
My co-worker told me to checkout a Git repo that he's been working on.
The app uses NodeJS. I did "git clone" and then "npm install". My co-worker told me to then run "npm start". I tried this and I got an error. We decided the problem was my old version of Node. He was running with version 4 and I was way back on 0.6.
So I upgraded. I am on a Mac. I uninstalled Node using Homebrew, then re-installed Node using Homebrew.
Now:
node -v
v6.5.0
So now I do "npm install" and then "npm start". Now I get a different error:
npm start
> api-reference#0.0.1 start /Users/lLRK9/projects/zeria/api
> node server.js
module.js:457
throw err;
^
Error: Cannot find module './config/manifest.json'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/lLRK9/projects/zeria/api/server.js:5:18)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.5.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! api-reference#0.0.1 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api-reference#0.0.1 start script 'node server.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 api-reference package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs api-reference
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls api-reference
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/lLRK9/projects/zeria/api/npm-debug.log
cat /Users/lLRK9/projects/zeria/api/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/6.5.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'start' ]
2 info using npm#3.10.3
3 info using node#v6.5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle api-reference#0.0.1~prestart: api-reference#0.0.1
6 silly lifecycle api-reference#0.0.1~prestart: no script for prestart, continuing
7 info lifecycle api-reference#0.0.1~start: api-reference#0.0.1
8 verbose lifecycle api-reference#0.0.1~start: unsafe-perm in lifecycle true
9 verbose lifecycle api-reference#0.0.1~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/lLRK9/projects/zeria/api/node_modules/.bin:/usr/local/Cellar/node/6.5.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar/node/6.5.0/bin/node:/usr/local/bin/brew:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin
10 verbose lifecycle api-reference#0.0.1~start: CWD: /Users/lLRK9/projects/zeria/api
11 silly lifecycle api-reference#0.0.1~start: Args: [ '-c', 'node server.js' ]
12 silly lifecycle api-reference#0.0.1~start: Returned: code: 1 signal: null
13 info lifecycle api-reference#0.0.1~start: Failed to exec start script
14 verbose stack Error: api-reference#0.0.1 start: `node server.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:242:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191: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:191:7)
14 verbose stack at maybeClose (internal/child_process.js:877:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid api-reference#0.0.1
16 verbose cwd /Users/lLRK9/projects/zeria/api
17 error Darwin 15.6.0
18 error argv "/usr/local/Cellar/node/6.5.0/bin/node" "/usr/local/bin/npm" "start"
19 error node v6.5.0
20 error npm v3.10.3
21 error code ELIFECYCLE
22 error api-reference#0.0.1 start: `node server.js`
22 error Exit status 1
23 error Failed at the api-reference#0.0.1 start script 'node server.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the api-reference package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node server.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs api-reference
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls api-reference
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
This app works for my co-worker. What differences in our setups might allow this app to work for him, but not for me?
Error: Cannot find module './config/manifest.json'
This looks like some local config file you're missing. You should ask him for it.
Alternatively, if there is an install hook in the package.json of the module, it may be attempting to configure this manifest.json file automatically, and it's possible that install script failed. You should check if there is any custom install hook as well.
(Also, I'd recommend using n in the future for managing Node.js versions).