I have the following error when trying to install the nestjs client, I honestly do not understand this error.
PS C:\Users\meuser> npm i -g #nestjs/cli
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #angular-devkit/core#12.2.10.
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\meuser\AppData\Local\npm-cache\_logs\2021-10-22T15_23_52_127Z-debug.log
Here I leave my versions and my packages installed. But I do not know why in the installation it does not find the package https://www.npmjs.com/package/#angular-devkit/core/v/12.2.10
PS C:\Users\meuser> npm -v
7.24.1
PS C:\Users\meuser> node -v
v12.18.4
PS C:\Users\meuser> npm list -g
C:\Users\meuser\AppData\Roaming\npm
+-- #angular/cli#12.2.7
+-- #vue/cli#4.5.13
+-- create-react-app#3.4.1
+-- npm#7.24.1
+-- typescript#4.4.3
+-- vsts-npm-auth#0.41.0
`-- yarn#1.22.11
Can you show your node version?
Also, a workaround could be changing #angular-devkit/core#12.2.10 into #angular-devkit/core. This will try to find a matching version of the dependency to your environment specifics.
I had to reinstall nodejs and it solved the problem
Related
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 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
So I am getting this error:
bash-3.2$ yo meanjs
You're using the official MEAN.JS generator.
? What mean.js version would you like to generate? 0.4.0
0.4.0
? In which folder would you like the project to be generated? This can be changed later. mean
Cloning the MEAN repo.......
? What would you like to call your application? MEAN
? How would you describe your application? Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js
? How would you describe your application in comma seperated key words? MongoDB, Express, AngularJS, Node.js
? What is your company/author name?
? Would you like to generate the article example CRUD module? Yes
? Would you like to generate the chat example module? Yes
Running npm install for you....
This may take a couple minutes.
Error: Command failed: /bin/sh -c cd mean && npm install
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/mona/.nvm/versions/node/v4.0.0/bin/node" "/Users/mona/.nvm/versions/node/v4.0.0/bin/npm" "install"
npm ERR! node v4.0.0
npm ERR! npm v2.14.2
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect
npm ERR! network connect ETIMEDOUT 23.235.39.162:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is 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'
npm ERR! Please include the following file with any support request:
npm ERR! /Users/mona/interviews/mean/mean/npm-debug.log
at ChildProcess.exithandler (child_process.js:203:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)
Please help me fix it.
History of the commands I've entered:
567 git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
569 . ~/.nvm/nvm.sh
570 vim ~/.bashrc
571 source ~/.bashrc
572 nvm install 4.0
573 nvm use 4.0
574 cd ..
578 yo meanjs
579 sudo rm -rf mean/
580 yo meanjs
Also:
bash-3.2$ npm info generator-meanjs version
0.4.4
Additional information just in case:
bash-3.2$ npm install -g generator-meanjs
npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
> spawn-sync#1.0.15 postinstall /Users/mona/.nvm/versions/node/v4.0.0/lib/node_modules/generator-meanjs/node_modules/yeoman-generator/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall
/
> yo#1.5.1 postinstall /Users/mona/.nvm/versions/node/v4.0.0/lib/node_modules/generator-meanjs/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✖ Node.js version
Your Node.js version is outdated.
Upgrade to the latest version: https://nodejs.org
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✖ npm version
Your npm version is outdated.
Upgrade to the latest version by running:
npm install -g npm
Found potential issues on your machine :(
generator-meanjs#0.4.4 /Users/mona/.nvm/versions/node/v4.0.0/lib/node_modules/generator-meanjs
├── mkdirp#0.5.1 (minimist#0.0.8)
├── chalk#1.1.1 (escape-string-regexp#1.0.5, supports-color#2.0.0, strip-ansi#3.0.1, has-ansi#2.0.0, ansi-styles#2.2.0)
├── ejs#2.3.4
├── underscore.string#3.2.3
├── bluebird#3.0.6
├── underscore.inflections#0.2.1 (underscore#1.8.3)
├── rimraf#2.5.2 (glob#7.0.3)
├── lodash#4.0.1
├── html-wiring#1.2.0 (detect-newline#1.0.3, cheerio#0.19.0)
├── yeoman-generator#0.21.1 (read-chunk#1.0.1, detect-conflict#1.0.0, yeoman-welcome#1.0.1, path-is-absolute#1.0.0, text-table#0.2.0, user-home#2.0.0, xdg-basedir#2.0.0, dargs#4.1.0, class-extend#0.1.2, yeoman-assert#2.1.1, debug#2.2.0, istextorbinary#1.0.2, find-up#1.1.2, path-exists#2.1.0, async#1.5.2, nopt#3.0.6, shelljs#0.5.3, cli-table#0.3.1, glob#5.0.15, through2#2.0.1, mem-fs-editor#2.2.0, yeoman-environment#1.5.2, read-pkg-up#1.0.1, pretty-bytes#2.0.1, github-username#2.1.0, cross-spawn#2.1.5, inquirer#0.11.4, dateformat#1.0.12, download#4.4.3, gruntfile-editor#1.1.0, lodash#3.10.1, sinon#1.17.3)
└── yo#1.5.1 (titleize#1.0.0, figures#1.4.0, humanize-string#1.0.1, user-home#2.0.0, string-length#1.0.1, async#1.5.2, opn#3.0.3, repeating#2.0.0, sort-on#1.2.2, configstore#1.4.0, root-check#1.0.0, yeoman-character#1.1.0, yosay#1.1.0, npm-keyword#4.2.0, package-json#2.3.1, cross-spawn-async#2.1.9, got#5.5.0, yeoman-environment#1.5.2, fullname#2.1.0, inquirer#0.11.4, meow#3.7.0, read-pkg-up#1.0.1, update-notifier#0.5.0, insight#0.7.0, lodash#3.10.1, yeoman-doctor#2.1.0)
bash-3.2$ npm ls
# /Users/mona/interviews/mean
└── (empty)
I am confused which version of node I should eventually go with!!? As I switched back to node 4.0 to solve the problem but now yo is complaining about the version not being the latest.
I'm getting this error while running npm install on project. The additional information about this issue below,
npm ERR! node-sass#0.9.6 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#0.9.6 install script 'node build.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/capricornus/Projects/aware-app/npm-debug.log
Just install older version of Nodejs with nodebrew.
curl -L git.io/nodebrew | perl - setup
Add the following to ~/.bashrc
export PATH=$HOME/.nodebrew/current/bin:$PATH
Refresh console
source ~/.bashrc
Install older version
nodebrew install-binary v0.12.7
nodebrew use v0.12.7
Then try again!
It looks like this version is no longer compatible. I get the same errors on my system. Either you need to downgrade node to the supported version, or upgrade the dependencies that require node-sass#0.9.6.
Latest version of node-sass is 3.4.2.
In case someone runs into trouble with nodebrew, it's also possible to use nvm (node version manager) to downgrade your node version. Project on Github
On OSX El Capitan, I needed this for the installation:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
. ~/.nvm/nvm.sh
Mind the last line, as it's slightly different from the install instruction on github.
As mentioned by Yosuke Sato, v0.12.7 is compatible with node-sass#0.9.6, so you'd need
nvm install v0.12.7 or nvm use v0.12.7 (if you have it installed already)
This will use the older node version, but only in the current terminal window/tab.
nvm use v0.12.7 in the project directory followed by npm install solved the problem for me -- the error occurred as I was trying to set up broccoli-taco, a static site generator. Thanks for tip, I am glad I googled you up.
I am trying to install node in my mac..
i am getting the following error...
i downloaded the node from node site and ran that package...
can you guys tell me why i am facing that errror..when i do npm install
MacBook-Pro:~ Raj$ npm install
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open '/Users/Raj/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/Raj
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /Users/Raj/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Raj/npm-debug.log
npm ERR! not ok code 0
Running just "npm install" will look for dependencies listed in your package.json. The error you're getting says that you don't have a package.json file set up (or you're in the wrong directory).
If you're trying to install a specific package, you should use 'npm install {package name}'. See here for more info about the command.
Otherwise, you'll need to create a package.json file for your dependencies or go to the right directory and then run 'npm install'.
I had this problem when trying to run 'npm install' in a Terminal window which had been opened before installing Node.js.
Opening a new Terminal window (i.e. bash session) worked. (Presumably this provided the correct environment variables for npm to run correctly.)
In my case it was due to a bad URL (http:// instead of git://, no .git at the end) for one of the dependencies.
You're likely not in the node directory. Try switching to the directory that you unpacked node to and try running the command there.
In case it helps anyone else - my issue was a rookie error, I had a space in the name line of my package.json and it caused the dependencies to be unreadable.
I came across this, and my issue was using an older version of node (3.X), when a newer version was required.
The error message actually suggested this as well:
...
Make sure you have the latest version of node.js and npm installed
...
So the solution may be as simple as upgrading node/npm. You can easily do this using nvm, the "Node Version Manager"
After you've installed nvm, you can install and use the latest version of node by simply running this command:
nvm install node
For example:
$ nvm install node
Downloading https://nodejs.org/dist/v8.2.1/node-v8.2.1-darwin-x64.tar.xz...
######################################################################## 100.0%
Now using node v8.2.1 (npm v5.3.0)
$ node --version
v8.2.1
In mac you might have downloaded and installed Node js in
/Users/yourusername/Downloads/nodejs-todo-master , so go here and run npm install command, no need of sudo as well., you should get output like this...
underscore#1.4.4 node_modules/underscore
ejs#0.8.8 node_modules/ejs
redis#0.8.6 node_modules/redis
jasmine-node#1.0.28 node_modules/jasmine-node
├── walkdir#0.0.7
├── coffee-script#1.8.0 (mkdirp#0.3.5)
├── requirejs#2.1.15
└── jasmine-reporters#1.0.1 (mkdirp#0.3.5)
express#3.0.6 node_modules/express
├── methods#0.0.1
├── fresh#0.1.0
├── range-parser#0.0.4
├── cookie-signature#0.0.1
├── buffer-crc32#0.1.1
├── cookie#0.0.5
├── commander#0.6.1
├── mkdirp#0.3.3
├── debug#2.1.0 (ms#0.6.2)
├── send#0.1.0 (mime#1.2.6)
└── connect#2.7.2 (pause#0.0.1, bytes#0.1.0, formidable#1.0.11, qs#0.5.1)
First download json package file from https://github.com/npm/read-package-json
and then run npm install from terminal.
This is all because you are not in the desired directory. You need to first get into the desired directory. Mine was angular-phonecat directory. So I typed in cd angular-phonecat and then npm install.
If someone is in my situation facing this error and have tried all the above solutions, like:
you are in the right directory
you have a package.json file,
the JSON is valid,
you have tried to run %temp%
you have tried " npm install -d --save"
etc.
Mine worked by doing "npm install --force"
Note: This was also recommended in the error itself, which I didn't pay attention to earlier.
Even " Yarn install" worked.
npm install -d --save worked for me. -d flag command force npm to install your dependencies and --save will save the all updated dependencies in your package.json
For me I'm on windows 10 X64...
My code npm install on cmd failed
So instead of npm i used Yarn
Just type yarn install instead of npm install
This fixed my problem.Tried for 2 days finally found the best
solution
To install yarn , on cmd enter the following code
npm install --global yarn
To check if it has installed correctly enter the following code
yarn --version
Hey if you found error and it stuck while installing then try this
Open run and type %Temp% and delete all file
Then type prefetch on run app an delete all files then try it
These Will do the Job
npm install -g yarn
yarn install
or
npm install --force
Hey if you found error and stcuk while installing packages
,getting only three files like json file ,lock file and module file using yarn then try this using yarn.
Open run and type %Temp% and delete all file
Then type prefetch on run app an delete all files
Then type on CMD npx create -react-app it will give you all packages