I am trying to install VueJS but I am getting errors.
I am using Bash on Ubuntu on Windows
node -v
v15.12.0
npm -v
7.6.3
Firt I tried this
npm install -g #vue/cli
But this returns me some warnings and errors
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v15.12.0/lib/node_modules/#vue/cli/node_modules/core-js
npm ERR! command failed
npm ERR! command sh -c node -e "try{require('./postinstall')}catch(e){}"
npm ERR! sh: 1: node: Permission denied
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-03-20T13_34_56_981Z-debug.log
I tried it with sudo but I am running it already as administrator.
sudo: npm: command not found
After that I tried npm install -g --unsafe-perm #vue/cli but I got the same error message as before.
After that I tried
npm config set user 0
npm config set unsafe-perm true
and after I tried that I did againnpm install -g #vue/cli but this also returned the same error.
Then I tried this
npm install vue
npm cache clean --force
npm install -g #vue/cli
But this also didn't worked for me it returned the same error....
So can someone help to fix this error?
This installation issue can be avoided by using yarn instead of npm:
yarn global add #vue/cli
Try a new terminal session and start with an npm update
Related
I don't know what changed on my windows PC, but I can't install any packages on my PC right now. I tried installing these packages today:
npm install needle
npm install got
npm install oauth-1.0a
and I received very similar error messages. I didn't have this problem before so I'm really confused as to why i'm having these errors now.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command C:\Program Files\nodejs\node.exe C:\Users\Tyree\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\Tyree\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > wyvern-schemas#0.14.1 prepublish
npm ERR! > scripts/build.sh
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN skipping integrity check for git dependency ssh://git#github.com/ProjectOpenSea/wyvern-js.git
npm ERR! npm WARN skipping integrity check for git dependency ssh://git#github.com/ahultgren/async-eventemitter.git
npm ERR! npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm ERR! npm WARN deprecated uuid#3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! npm WARN deprecated safe-event-emitter#1.0.1: Renamed to #metamask/safe-event-emitter
npm ERR! npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated mkdirp-promise#5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm ERR! npm WARN deprecated nomnom#1.8.1: Package no longer supported. Contact support#npmjs.com for more info.
npm ERR! npm WARN deprecated multibase#0.7.0: This module has been superseded by the multiformats module
npm ERR! npm WARN deprecated multibase#0.6.1: This module has been superseded by the multiformats module
npm ERR! npm WARN deprecated mkdirp#0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! npm WARN deprecated multicodec#0.5.7: This module has been superseded by the multiformats module
npm ERR! npm WARN deprecated popper.js#1.14.3: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm ERR! npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm ERR! npm WARN deprecated ethereumjs-block#2.2.2: New package name format for new versions: #ethereumjs/block. Please update.
npm ERR! npm WARN deprecated eth-sig-util#1.4.2: Deprecated in favor of '#metamask/eth-sig-util'
npm ERR! npm WARN deprecated ethereumjs-block#2.2.2: New package name format for new versions: #ethereumjs/block. Please update.
npm ERR! npm WARN deprecated uuid#2.0.1: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! npm WARN deprecated ethereumjs-tx#2.1.2: New package name format for new versions: #ethereumjs/tx. Please update.
npm ERR! npm WARN deprecated ethereumjs-tx#2.1.2: New package name format for new versions: #ethereumjs/tx. Please update.
npm ERR! npm WARN deprecated ethashjs#0.0.8: New package name format for new versions: #ethereumjs/ethash. Please update.
npm ERR! npm WARN deprecated ethereumjs-blockchain#4.0.4: New package name format for new versions: #ethereumjs/blockchain. Please update.
npm ERR! npm WARN deprecated uuid#3.2.1: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! npm WARN deprecated ethereumjs-tx#1.3.7: New package name format for new versions: #ethereumjs/tx. Please update.
npm ERR! npm WARN deprecated ethereumjs-vm#2.6.0: New package name format for new versions: #ethereumjs/vm. Please update.
npm ERR! npm WARN deprecated ethereumjs-block#1.7.1: New package name format for new versions: #ethereumjs/block. Please update.
npm ERR! npm WARN deprecated multicodec#1.0.4: This module has been superseded by the multiformats module
npm ERR! npm WARN deprecated ethereumjs-common#1.5.2: New package name format for new versions: #ethereumjs/common. Please update.
npm ERR! npm WARN deprecated ethereumjs-account#3.0.0: Please use Util.Account class found on package ethereumjs-util#^7.0.6 https://github.com/ethereumjs/ethereumjs-util/releases/tag/v7.0.6
npm ERR! npm WARN deprecated ethereumjs-block#2.2.2: New package name format for new versions: #ethereumjs/block. Please update.
npm ERR! npm WARN deprecated axios#0.17.1: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm ERR! npm WARN deprecated ethereumjs-tx#2.1.2: New package name format for new versions: #ethereumjs/tx. Please update.
npm ERR! npm WARN deprecated cids#0.7.5: This module has been superseded by the multiformats module
npm ERR! npm WARN deprecated ethereumjs-vm#4.2.0: New package name format for new versions: #ethereumjs/vm. Please update.
npm ERR! npm WARN deprecated core-js#2.6.12: core-js#<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! 'scripts' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path C:\Users\Tyree\AppData\Local\npm-cache\_cacache\tmp\git-clonemSjZbY
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c scripts/build.sh
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! C:\Users\Tyree\AppData\Local\npm-cache\_logs\2022-10-19T19_46_18_861Z-debug-0.log
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Tyree\AppData\Local\npm-cache\_logs\2022-10-19T19_46_17_124Z-debug-0.log
Try Uninstalling and Re-installing Node to the latest Stable Version.
I am trying to create a React Native project using this command:
npx react-native init
But the template download just stops and shows the following message:
× Downloading template
error Error: Command failed: npm install --save --save-exact react-native#latest
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated uglify-es#3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno -4077
npm ERR! network read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
Here, below "Creating a new application" title
If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues:
npm uninstall -g react-native-cli #react-native-community/cli
then
npx react-native init AwesomeProject
I uninstalled react-scripts trying to fix bug in terminal earlier. Now when I run npm install react-scripts it gives me this:
Cole#Coles-MacBook-Pro-4 client % npm i react-scripts
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
npm WARN deprecated rollup-plugin-babel#4.4.0: This package has been deprecated and is no longer maintained. Please use #rollup/plugin-babel.
npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js#2.6.12: core-js#<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
added 1881 packages, changed 1 package, and audited 1986 packages in 58s
138 packages are looking for funding
run `npm fund` for details
87 vulnerabilities (81 moderate, 6 high)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
But when I run npm uninstall react-scripts it gives me this:
Cole#Coles-MacBook-Pro-4 client % npm uninstall react-scripts
removed 1882 packages, and audited 104 packages in 15s
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Obviously I do need react-scripts so I can start my project up in development. When I run npm start with react-scripts uninstalled, it gives me sh: react-scripts: command not found
How can I install react-scripts without causing vulnerabilities?
Edit: When I try npm audit fix it gives me this nasty message:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: type-fest#0.21.3
npm ERR! node_modules/type-fest
npm ERR! type-fest#"^0.21.3" from ansi-escapes#4.3.2
npm ERR! node_modules/ansi-escapes
npm ERR! ansi-escapes#"^4.2.1" from #jest/core#26.6.3
npm ERR! node_modules/#jest/core
npm ERR! #jest/core#"^26.6.0" from jest#26.6.0
npm ERR! node_modules/jest
npm ERR! peer jest#"^26.0.0" from jest-watch-typeahead#0.6.1
npm ERR! node_modules/jest-watch-typeahead
npm ERR! 1 more (react-scripts)
npm ERR! 1 more (jest-cli)
npm ERR! ansi-escapes#"^4.3.1" from jest-watch-typeahead#0.6.1
npm ERR! node_modules/jest-watch-typeahead
npm ERR! jest-watch-typeahead#"0.6.1" from react-scripts#4.0.3
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"^4.0.3" from the root project
npm ERR! 2 more (jest-watcher, terminal-link)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional type-fest#"^0.13.1" from #pmmmwh/react-refresh-webpack-plugin#0.4.3
npm ERR! node_modules/#pmmmwh/react-refresh-webpack-plugin
npm ERR! #pmmmwh/react-refresh-webpack-plugin#"0.4.3" from react-scripts#4.0.3
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"^4.0.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/Cole/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Cole/.npm/_logs/2021-05-26T13_04_40_793Z-debug.log
Maybe I have to uninstall and reinstall the entire create-react-app package? I started a different project in a different folder and it still had the same problems right after entering npx create-react-app <name>. Sounds like my whole computer is messed up now.
How can I install react-scripts without causing vulnerabilities?
You can't. You have to wait for the author (in this case, Facebook) to update its dependencies to remove vulnerabilities.
When I try to install truffle using npm, the following output appears:
npm WARN deprecated mkdirp-promise#5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated multicodec#0.5.7: stable api reached
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated mkdirp#0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated node-pre-gyp#0.11.0: Please upgrade to #mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the #mapbox scoped package will recieve updates in the future
npm WARN deprecated redux-devtools-core#0.2.1: Package moved to #redux-devtools/app.
npm WARN deprecated redux-devtools-instrument#1.10.0: Package moved to #redux-devtools/instrument.
npm WARN deprecated remotedev-serialize#0.1.9: Package moved to #redux-devtools/serialize.
npm WARN deprecated core-js#2.6.12: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated axios#0.20.0: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated circular-json#0.5.9: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated debug#4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated fsevents#2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2
(node_modules/truffle/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jerry/.npm/_logs/2021-04-23T13_13_53_567Z-debug.log
I think it's because I do not have access as root admin. I tried restarting my PC but it still doesn't work. There's also an error where it says something about my OS. I have no ideas as I am new to Ethereum development.
I had this problem as well, and it seems the problem is how truffle packages are managed or deployed on npm, I instead used:
yarn global add truffle
And it worked. Please try it. From my experience, npm install -g truffle does not work on a Linux Ubuntu 20.04 setup(which was my environment), but it worked when I ran it on a WSL Ubuntu 20.04 Terminal. This is something maybe the truffle team may keep in mind. I also realized there are warnings around using sudo npm install -g truffle, so don't use it.
Yes, you need admin permissions to install NPM packages globally, prepend the command with sudo:
sudo npm install -g truffle
I installed Node.js using Snap on my Parrot OS system.
I don't know why, but I don't have the node_modules folder after /usr/local/lib
This is the error I get with npm install -g #vue/cli
npm WARN deprecated #hapi/joi#15.1.1: joi is leaving the #hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/address#2.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
/usr/local/bin/vue -> /usr/local/lib/node_modules/#vue/cli/bin/vue.js
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2913/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> core-js#3.6.5 postinstall /usr/local/lib/node_modules/#vue/cli/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
2020/08/12 15:51:38.149740 cmd_run.go:918: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/2913": mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/2913: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/#vue/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN #vue/compiler-sfc#3.0.0-rc.5 requires a peer of vue#3.0.0-rc.5 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! core-js#3.6.5 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the core-js#3.6.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! /root/.npm/_logs/2020-08-12T10_21_41_518Z-debug.log
edit :-
while using sudo i get the following error - sudo: npm: command not found. So I ran su first, then tried npm install -g #vue/cli but then i get the error originally asked in the question.
When you install npm packages globally, you have to run the install command as administrator.
try to run,
sudo npm install -g #vue/cli