My Goal:wanna initialize Vue.js project by running commands vue init webpack myproject
Expected Result: install all the dependencies with no fatal error, AND would be able to start running the project by npm dev run,and run project on http://localhost:8080
ACTUAL Result:
# Installing project dependencies ...
# ========================
npm WARN deprecated extract-text-webpack-plugin#3.0.2: Deprecated. Please use https://gi
thub.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated browserslist#2.11.3: Browserslist 2 could fail on reading Browsersli
st >3.0 config used in other tools.
npm WARN deprecated bfj-node4#5.3.1: Switch to the `bfj` package for fixes and new featu
res!
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommend
ed for usage due to the number of issues. Please, upgrade your dependencies to the actua
l version of core-js#3.
npm WARN deprecated browserslist#1.7.7: Browserslist 2 could fail on reading Browserslis
t >3.0 config used in other tools.
npm WARN deprecated circular-json#0.3.3: CircularJSON is in maintenance only, flatted is
its successor.
npm ERR! Unexpected end of JSON input while parsing near '...,"dist":{"shasum":"1e'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_01_01_
430Z-debug.log
Running eslint --fix to comply with chosen preset rules...
# ========================
> travel#1.0.0 lint F:\SourceCode\Travel-master\Travel
> eslint --ext .js,.vue src "--fix"
Oops! Something went wrong! :(
ESLint: 6.8.0.
ESLint couldn't find the plugin "eslint-plugin-vue".
(The package "eslint-plugin-vue" was not found when loaded as a Node module from the dir
ectory "F:\SourceCode\Travel-master\Travel".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the f
ollowing:
npm install eslint-plugin-vue#latest --save-dev
The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js".
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslin
t to chat with the team.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! travel#1.0.0 lint: `eslint --ext .js,.vue src "--fix"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the travel#1.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging out
put above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_01_04_
492Z-debug.log
# Project initialization finished!
# ========================
To get started:
cd Travel
npm run dev
Documentation can be found at https://vuejs-templates.github.io/webpack
What I've tried
run the commands like above mentioned npm install eslint-plugin-vue#latest --save-dev,then comes another issue like below:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for eslint-plugin-vue#lastest.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_09_11_
766Z-debug.log
even I tried the npm install webpack -dev-server -g,then comes another issue like below:
C:\Program Files\nodejs\webpack -> C:\Program Files\nodejs\node_modules\webpack\bin\webp
ack.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\webpack\no
de_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11:
wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ webpack#4.41.6
added 322 packages from 197 contributors in 255.517s
I had the same problem when coding my app (MEVN) and using the command vue init webpack client.
So I did a bit of research notably on npm to see what was wrong and found this: https://www.npmjs.com/package/vue-cli so apparently you can't use this command anymore.
So if you wish to use the vue cli you need to install it trough npm install -g #vue/cli and then run vue create <dir name>
For further information you can look into the documentation: https://www.npmjs.com/package/#vue/cli with the documentation on the vuejs website: https://cli.vuejs.org/
Hope this helps and have fun coding
Related
although I am good in react but when I was tiring to install react version 1.2.5, I was getting this error again and again for running
npm i -g create-react-app#1.2.5
Output
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global`
instead.
npm ERR! code ETARGET
npm ERR! notarget No matching version found for create-react-app#1.2.5.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sibri\AppData\Local\npm-cache\_logs\2022-06-14T07_21_55_731Z-
debug-0.log
Anyone got any idea where I went wrong
As I can see in the returned error you should use --location=global instead of -g flag.
My app uses sass, not node-sass. node-sass is nowhere in my package-lock.json.
I'm currently using npm 6 and everything is working fine and has been for years.
When I try to npm install with npm 7, it fails with the below error.
What's going on? Maybe node-sass is a dev dependency of something else and being built?
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/john/.npm/_cacache/tmp/git-clonenbaf30/node_modules/node-sass
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node scripts/build.js
npm ERR! npm ERR! Building: /opt/local/bin/node /Users/john/.npm/_cacache/tmp/git-clonenbaf30/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! npm ERR! c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.3.6"' -I/Users/john/.node-gyp/14.18.3/include/node -I/Users/john/.node-gyp/14.18.3/src -I/Users/john/.node-gyp/14.18.3/deps/uv/include -I/Users/john/.node-gyp/14.18.3/deps/v8/include -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/eval.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/eval.o ../src/libsass/src/eval.cpp
### above line repeated many times
npm ERR! npm ERR!
You might be using a version of Node or npm that are not compatible with the version of node-sass that is being pulled. node-sass publishes this table that shows the range of supported versions for any toolchain version. If one of your dependencies is pulling node-sass, you could force your desired version by explicitly specifying node-sass as a direct dependency. You could also consider upgrading Node or npm as an alternative.
To see what would happen I tried npm install --package-lock-only, and it succeeded. I could then see the dependency tree. node_modules/sass-loader has node-sass as a peer dependency.
npm7 installs peer dependencies by default and doesn't allow getting into an ambiguous state. (more info: https://stackoverflow.com/a/22004559/168143 )
So, that's why this was happening. I don't know if I wasn't reading the stack trace well enough or if there is some other standard way for me to have figured out what had the dependencies. I'll leave this question without an accepted answer just in case someone has a smarter way to diagnose this sort of thing.
I have installed webpack now I am trying to install webpack-cli but following errors occur:
$ npm i --save-dev webpack-cli
> webpack-cli#3.2.1 postinstall D:\Development\Practices\sample\starter\node_modules\webpack-cli
> lightercollective
'lightercollective' is not recognized as an internal or external command,
operable program or batch file.
npm WARN starter#1.0.0 No description
npm WARN starter#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webpack-cli#3.2.1 postinstall: `lightercollective`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-cli#3.2.1 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\rajan\AppData\Roaming\npm-cache\_logs\2019-01-08T08_45_44_898Z-debug.log
Notes:
I have tried restarting my command line.
I have also tried npm cache clean --force
And googling about an hour.
Finally, what does that lightercollective is not recognized as.. in the above message means? Confused???
Install:
npm i -g lightercollective
They change stuff... you must specify version numbers when you get packages or it won't work in the future if there is some sort of a breaking change.
You can add lightercollective to your dependencies to solve the issue.
Official package page
"lightercollective": "^0.0.0"
Update webpack-cli: npm update webpack-cli --save-dev
In my situation, I went from 3.2.1 (which warned about "lightercollective") to 3.3.8. Seemed like the issue was resolved.
I am trying to run npm install on my terminal as part of the setup for angular-phonecat as per the instructions on https://docs.angularjs.org/tutorial
When I run the command I am getting issues with deprecated modules and errors when reaching the bower install section.
Does anybody know how I can update the deprecated modules to avoid the warnings and how I can fix the bower errors?
Here is the output I am receiving:
npm WARN deprecated tough-cookie#2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
-
> fsevents#1.0.14 install /Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/karma/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/karma/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> angular-phonecat#0.0.0 postinstall /Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat
> bower install
bower EACCES EACCES: permission denied, unlink '/Users/Eamon/.cache/bower/registry/bower.herokuapp.com/lookup/jquery_d223e'
Stack trace:
Error: EACCES: permission denied, unlink '/Users/Eamon/.cache/bower/registry/bower.herokuapp.com/lookup/jquery_d223e'
at Error (native)
Console trace:
Error
at StandardRenderer.error (/Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/bower/lib/renderers/StandardRenderer.js:81:37)
at Logger.<anonymous> (/Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/bower/lib/bin/bower.js:110:26)
at emitOne (events.js:77:13)
at Logger.emit (events.js:169:7)
at Logger.emit (/Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js:29:39)
at /Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/bower/lib/commands/index.js:48:20
at _rejected (/Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/bower/lib/node_modules/q/q.js:844:24)
at /Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/bower/lib/node_modules/q/q.js:870:30
at Promise.when (/Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/bower/lib/node_modules/q/q.js:1122:31)
at Promise.promise.promiseDispatch (/Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/node_modules/bower/lib/node_modules/q/q.js:788:41)
System info:
Bower version: 1.7.9
Node version: 4.4.0
OS: Darwin 15.6.0 x64
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.4.0
npm ERR! npm v2.14.20
npm ERR! code ELIFECYCLE
npm ERR! angular-phonecat#0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-phonecat#0.0.0 postinstall script 'bower install'.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-phonecat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Eamon/Documents/Scripting/Web Development/Learning/Javascript/Angularjs/angular-phonecat/npm-debug.log
I have tried searching on other posts with similar issues but none of these have helped me find a solution:
error when npm install
Got an error while running "npm install" on angular-phonecat directory
Cannot npm install for angular-phonecat tutorial : Cannot find module 'update-notifier'
I have also tried running sudo npm install with the same issue. I have a feeling the bower install issues are due to the setup of the bower cache looking at the error output but I am not 100% certain.
Has anyone encountered similar issues when setting up the installation for angular-phonecat?
Any help would be greatly welcomed.
Many Thanks,
Eamon
ISSUE: You (the user) don't have the right set of permissions for the directory.
The instant way out is to run the npm install using sudo, but this may give you the same error, or improper installation.
AND changing directory ownership is not a good option, a temporary patch. I am answering the question, as I feel I have a more elegant solution/suggestion to the problem. I came across same issues multiple times i.e. 'npm install -g #angular/cli'.
Uninstalled the package and executed the following commands (in the order mentioned) to have clean installation.
Solution/Suggestion: Change npm's Default Directory (from official docs)
Back-up your computer before moving forward.
(optional) In case you have a erroneous installation, first uninstall it:
npm uninstall <package-name> # use sudo if you used it while installation
npm cache verify # or, npm cache clean for npm version below 5.x.x
Make a directory for global installations:
mkdir ~/.npm-global
Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
Open or create a ~/.profile or ~/.bash_profile file and add this line:
export PATH=~/.npm-global/bin:$PATH
Back on the command line, update your system variables, or restart the terminal:
source ~/.profile
(optional) Test: Download a package globally without using sudo.
npm install -g jshint
Having looked into this it appears that bower was having issues with permissions and was resolved by running the bower install separately using sudo:
sudo bower install --allow-root
However, you should not use sudo with bower. It is likely that if you have to then the ~/.cache has been set incorrectly either by installing using sudo or installing your first package via sudo. More info about this can be found here: http://www.competa.com/blog/2014/12/how-to-run-npm-without-sudo/
Instead you should rectify the ownership by running the following:
sudo chown -R $user ~/.npm
sudo chown -R $user ~/.config
To find your user you can simply run the following command on the command line:
$ whoami
If you want to open to a wider group you can also add a group to the chown command. To find out which group your user belongs to you can type the following command:
$ groups
To set the group at the same time as the user simply change the command to the following and replace $user and $group with your desired user and group:
sudo chown -R $user:$group ~/.npm
sudo chown -R $user:$group ~/.config
If you are seeing an issue like one of the below when running a bower install during your npm install:
EACCES: permission denied, open '/some/directory'
EACCES: permission denied, unlink '/some/directory'
You will need to change the permissions to the folder containing the file to be your user by doing:
sudo chown -R USER /some/directory
Just change the folder that the file is stored in, not the file itself. When you run npm install after this it will work if it needs to install any bower components that are having issues installing while using your current user and not using sudo.
Thanks,
Eamon
I'm using Ubuntu 15.04. While running the following command:
npm install fsevents
I'm getting following error:
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.11
npm WARN tutorial#1.0.0 No repository field.
Has anybody solved this?
I was facing the same issue with this dependecy when building other application.
Just for the sake of knowledge and to people who are not well used to NPM, and thus uncertain about how their applications will behave:
Since fsevents is an API in OS X allows applications to register for notifications of changes to a given directory tree. Running:
npm install --no-optional
Will do the trick, with no drawbacks.
It's not an error, it's just a warning: it's an optional dependency.
You can tell npm not to install optional dependencies by default using the command line below:
npm config set optional false
If you're getting ERR! not WARN a likely cause of this issue is that you're using a really outdated version of NPM
For me, I shelled into some server, and was like "why won't this work?", getting this error:
npm ERR! Linux 4.4.0-130-generic
npm ERR! argv "/home/william/.nvm/versions/node/v4.4.3/bin/node" "/home/william/.nvm/versions/node/v4.4.3/bin/npm" "install"
npm ERR! node v4.4.3
npm ERR! npm v2.15.1
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: fsevents#1.1.3
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: linux
npm ERR! notsup Actual Arch: x64
npm ERR! Please include the following file with any support request:
npm ERR! /home/william/app/mcard-api/npm-debug.log
Turns out this server (that I only recently acquired) was running npm 2.15.1. I re-installed nvm, and nvm install --lts fixed it.
I had same issue with dependency. Kindly check for the package.json file , add "typings":"^0.8.1" entry under devDependency section. dont forget to add comma before :) Hope it will resolve issue.
I was also facing this error when installing Redux:
$ npm install --save react-redux
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.14
What solved the issue was to add --no-optional (argument will prevent optional dependencies from being installed):
npm install --no-optional --save react-redux
^^^^^^^^^^^^^
And now it is correctly installed:
$ npm ls redux
ReduxProject# /home/me/projects/reduxproject
└── redux#3.5.2
I found if you use "yarn add ." Yarn will exclude the fsevents will not throw an error.