I've installed node on my debian squeeze dedicated server, but i can't install new mode module
ex : npm install async
Results :
root#....# npm install async
npm http GET https://registry.npmjs.org/async
npm ERR! Error: failed to fetch from registry: async
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:32:9)
npm ERR! at Request._callback (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:137:18)
npm ERR! at Request.callback (/usr/local/lib/node_modules/npm/node_modules/request/main.js:109:22)
npm ERR! at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:198:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:356:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1238:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Linux 3.2.13-xxxx-std-ipv6-64
npm ERR! command "node" "/usr/local/bin/npm" "install" "async"
npm ERR! cwd /root
npm ERR! node -v v0.6.8
npm ERR! npm -v 1.1.0-2
npm ERR! message failed to fetch from registry: async
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm not ok
UPDATE (1/11/2015):
I now use NVM to manage my node/npm installation on both Linux and Unix. It's super simple; just follow these steps.
Install NVM.
$ curl https://raw.githubusercontent.com/creationix/nvm/v0.22.1/install.sh | bash
Use NVM to install the latest stable version of node and NPM.
$ nvm install stable
Tell NVM to use the stable version as the default version in future bash instances.
$ nvm alias default stable
Now you're all set with node & NPM. NVM even gets rid of the permissions issues with NPM global modules on Ubuntu, which normally requires you to chown or sudo and causes all sorts of frustration. You can use NVM to install different versions of node/NPM side by side as well. You can switch between installed versions with nvm use {version}, as long as you've done nvm install {version} already.
I think you may be running a really old version of node & npm. I see that node is v0.6.8 and npm is 1.1.0-2 when the current versions are 0.10.26 & 1.4.6 respectively. I'd try upgrading your node and npm installs and then try installing modules again and see if that fixes it for you.
Head over to http://nodejs.org and click the big green button in order to get the node installer. It will install both node & npm together.
Note: It's sometimes better not to install node/npm from a package manager unless you're confident the version listed in the package manager is the latest version. It's important to keep npm up to date. Npm even updates itself along with all your global node modules when you run npm update -g.
Related
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated bcrypt#4.0.1: versions < v5.0.0 do not handle NUL in passwords properly
npm ERR! code 1
npm ERR! path /Users/nikhil/Desktop/admin/myprivatescout-master/node_modules/node
npm ERR! command failed
npm ERR! command sh -c node installArchSpecificPackage
npm ERR! npm ERR! code ETARGET
npm ERR! npm ERR! notarget No matching version found for node-darwin-arm64#16.6.1.
npm ERR! npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! npm ERR! notarget a package version that doesn't exist.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /Users/nikhil/.npm/_logs/2021-08-23T17_20_39_011Z-debug.log
npm ERR! node:internal/modules/cjs/loader:936
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'node-darwin-arm64/package.json'
npm ERR! Require stack:
npm ERR! - /Users/nikhil/Desktop/admin/myprivatescout-master/node_modules/node/installArchSpecificPackage.js
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR! at Function.resolve (node:internal/modules/cjs/helpers:100:19)
npm ERR! at ChildProcess.<anonymous> (/Users/nikhil/Desktop/admin/myprivatescout-master/node_modules/node-bin-setup/index.js:18:27)
npm ERR! at ChildProcess.emit (node:events:394:28)
npm ERR! at maybeClose (node:internal/child_process:1067:16)
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: [
npm ERR! '/Users/nikhil/Desktop/admin/myprivatescout-master/node_modules/node/installArchSpecificPackage.js'
npm ERR! ]
npm ERR! }
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/nikhil/.npm/_logs/2021-08-23T17_20_39_074Z-debug.log
I am unable to install any package in my project repository on my mac M1, already removed node_modules and package-lock.json and tried npm i after that.
tried running npm i, npm i for individual packages but couldn't fix it,
Also tried installing with yarn but I am facing the same issue.
Add the architecture to the node:
$ nvm uninstall 14
$ arch -x86_64 zsh
$ nvm install 14
$ nvm alias default 14
The solution provided by Nikhil is a good start. However, this is more complete and applicable in more situations:
First, install nvm (Node version manager):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
Then, run the following command:
arch -x86_64 zsh
We had a dev with this problem, a M1 laptop bought new in December 2021. The solution by ralphjsmit got us part of the way.
We're using Nodejs v16.13.1. After running arch -x86_64 zsh the npm install still failed (Error: Cannot find module 'node-darwin-arm64/package.json').
arch returned i386.
The key for us was to re-install Nodejs (via nvm, nvm use v16.5.0 && nvm uninstall v16.13.1 && nvm install v16.13.1)
If I were to summarize all the steps we ran, they'd be
> node -v
v16.13.1
> node -p process.arch
arm64
> arch -x86_64 zsh
> nvm use 16.5.0 && nvm uninstall v16.13.1 && nvm install v16.13.1
nvm use 16.5.0 && nvm uninstall v16.13.1 && nvm install v16.13.1
Now using node v16.5.0 (npm v7.19.1)
Uninstalled node v16.13.1
Downloading and installing node v16.13.1...
...
# output here, I am not on an M1 machine, but it mentions x64 in the name of the node binary file
...
Now using node v16.13.1 (npm v8.1.2)
> npm install
It seems that reinstalling an older version of NodeJS (& NPM) helped me.
Try version 14.18.3 from here.
Make sure you do not have a specified node version in package.json.
arch -arm64 npm i worked for me!
I have a system that when deploying tries to install browserify, but the installation is not completed by an HTTP 404 corresponding to the acorn5-object-spread plugin, as seen in the following console extract (node 0.10.42 and npm 1.3.6):
npm http 404 https://registry.npmjs.org/browserify/acorn5-object-spread
npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR! at next (/usr/lib/node_modules/npm/lib/cache.js:687:35)
npm ERR! at /usr/lib/node_modules/npm/lib/cache.js:675:5
npm ERR! at saved (/usr/lib/node_modules/npm-registry-client/lib/get.js:148:7)
npm ERR! at /usr/lib/node_modules/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 2.6.32-358.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "browserify" "minifyify" "jstify" "grunt"
npm ERR! cwd /var/lib/jenkins/jobs/SATI-Deploy frontend to localhost/workspace
npm ERR! node -v v0.10.42
npm ERR! npm -v 1.3.6
npm ERR! type non_object_property_load
If this can not be corrected, Could the acorn5-object-spread plugin be omitted or excluded?
The #browserify/acorn5-object-spread dependency is published as a scoped package. You're using a very very very old version of node and npm—npm v1 does not support scoped packages.
The best thing to do would be to upgrade your node and npm versions by downloading the latest stable or LTS version from https://nodejs.org or by running npm install --global npm#2. (I think npm v2 already supports scoped packages, but newer versions are even better.)
If that is not an option, you can downgrade your browserify dependency to v14.x or lower, since those do not depend on the acorn5-object-spread package.
// package.json:
"browserify": "^14.0.0"
Node is Updated to latest stable version v7.4.0
This is the error message I get when trying to install browser-sync:
sudo npm install -g browser-sync
'npm ERR! Linux 4.4.0-59-generic npm ERR! argv "/usr/local/bin/node"
"/usr/local/bin/npm" "install" "-g" "browser-sync" npm ERR! node
v7.4.0 npm ERR! npm v4.0.5 npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'internal/fs' npm ERR! npm ERR! If you
need help, you may report this error at: npm ERR!
https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! /home/pedro/npm-debug.log '
This problem occurs when you are installing a old module(as written in your package.json) but it is not available on git due to update in their version.
for solving this issue.
1.Need to install the project’s local dependencies (that’s where it’s looking for browser-sync). To do that,
2.cd into the project directory and run npm install.
3.You can also try npm i browser-sync --save
You're going to need to upgrade npm also (currently npm#next – npm -g install npm#next if you have it installed globally.
I have Solved the issue:
NPM Module was not supported by node v7:
So I downgraded to node v6.4.0 and it allowed me install browser-sync with no problems!
sudo npm cache clean -f
sudo npm install -g n
sudo n 6.9.5
I'm trying to get into a legacy program, which doesn't have any other developers remaining that worked on it over a year ago.
The readme says to install via npm install. When I ran that, it complained about the version of node and suggested node 0.8.x. Based on that I used nvm install 0.8.9 then did nvm use 0.8.9.
When I run npm install, I now get:
npm ERR! Error: No compatible version found: cheerio#'^0.17.0'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.2.0","0.2.1","0.2.2","0.3.0","0.3.1","0.3.2","0.4.0","0.4.1","0.4.2","0.5.0","0.5.1","0.5.2","0.6.0","0.6.1","0.6.2","0.7.0","0.8.0","0.8.1","0.8.2","0.8.3","0.9.0","0.9.1","0.9.2","0.10.0","0.10.1","0.10.2","0.10.3","0.10.4","0.10.5","0.10.6","0.10.7","0.10.8","0.11.0","0.12.0","0.12.1","0.12.2","0.12.3","0.12.4","0.13.0","0.13.1","0.14.0","0.15.0","0.16.0","0.17.0","0.18.0","0.19.0","0.20.0"]
npm ERR! at installTargetsError (~/.nvm/v0.8.9/lib/node_modules/npm/lib/cache.js:553:10)
npm ERR! at ~/.nvm/v0.8.9/lib/node_modules/npm/lib/cache.js:477:15
npm ERR! at saved (~/.nvm/v0.8.9/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR! at ~/.nvm/v0.8.9/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:220:7
npm ERR! at Object.oncomplete (fs.js:297:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Darwin 14.5.0
npm ERR! command "~/.nvm/v0.8.9/bin/node" "~/.nvm/v0.8.9/bin/npm" "install"
npm ERR! cwd ~/workspace/path/to/project
npm ERR! node -v v0.8.9
npm ERR! npm -v 1.1.61
What bothers me is the fact that it references ^0.17.0 and from reading, it sounds like that should support any 0.x.y version that is 0.17.0 or greater. Since 0.17.0, 0.18.0, 0.19.0 and 0.20.0 are in the list, I would assume that things should be just peachy.
If I do node install cheerio#0.17.0 then it seems to work, I then do another npm install and get a new package error like the above, I then manually do the version and it seems to loop back to the cheerio package.
Thoughts on what I'm missing?
Did you get '^0.17.0' from json? To work in cmd just remove apostrophe's.
npm install cheerio#^0.17.0
I am currently having trouble installing the grunt command line interface, i get a whole lot of errors on the log when I try and install it using instructions off a tutorial website. I just added node.js from a package I downloaded off their website. Any help would be appreciated?
I used the following command as detailed on the roots WordPress instructions page
npm install -g grunt-cli
and this error message was returned
npm ERR! Error: Attempt to unlock grunt-cli, which hasn't been locked
npm ERR! at unlock (/usr/local/lib/node_modules/npm/lib/utils/locker.js:44:11)
npm ERR! at cb (/usr/local/lib/node_modules/npm/lib/cache/add-local.js:30:5)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache/add-local.js:47:20
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/locker.js:30:7
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38
npm ERR! at OpenReq.Req.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:144:5)
npm ERR! at OpenReq.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:64:22)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /Users/jonbeech
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/jonbeech/npm-debug.log
npm ERR! not ok code 0
➜ ~
Run sudo npm install -g grunt-cli you need sudo privileges when installing something globally, or remove the -g switch.
Try to avoid needing sudo with npm, there are likely going to be other permissions errors. Here is what I did after installing npm with sudo:
Uninstall NPM: sudo npm uninstall npm -g
Install NVM so that I can install npm without needing sudo (similar to RVM), see: https://github.com/creationix/nvm#installation
Install latest npm: nvm install stable
Clear caches npm cache clear
and then everything worked