I am trying to install Yeoman using NPM, but am greeted by the following error:
Jaspers-MacBook-Pro:Sites Jasper$ sudo npm install --global yo
> fullname-native#0.1.1 install /usr/local/lib/node_modules/yo/node_modules/fullname/node_modules/fullname-native
> node-gyp rebuild
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: EPERM, utime '/Users/Jasper/.node-gyp/0.10.29'
gyp ERR! System Darwin 13.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/yo/node_modules/fullname/node_modules/fullname-native
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! <https://github.com/TooTallNate/node-gyp/issues>
npm WARN optional dep failed, continuing fullname-native#0.1.1
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js
> yo#1.2.0 postinstall /usr/local/lib/node_modules/yo
> node ./scripts/doctor
[Yeoman Doctor] Everything looks alright!
npm WARN unmet dependency /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/download/node_modules/request/node_modules/form-data requires async#'~0.9.0' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async,
npm WARN unmet dependency which is version 0.2.10
Since Yeoman doctor says "looks allright", I tried to install te angular generator
npm install -g generator-angular
yo angular
This just returned some more errors:
npm ERR! Error: EACCES, open '/Users/Jasper/.npm/lodash/2.4.1/package/package.json'
npm ERR! { [Error: EACCES, open '/Users/Jasper/.npm/lodash/2.4.1/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/Jasper/.npm/lodash/2.4.1/package/package.json',
npm ERR! parent: 'grunt-karma' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "karma-phantomjs-launcher" "karma-jasmine" "grunt-karma" "--save-dev"
npm ERR! cwd /Users/Jasper/Sites/test
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/Jasper/.npm/lodash/2.4.1/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/Jasper/.npm/lodash/2.4.1/package/package.json'
npm ERR! Error: EACCES, open '/Users/Jasper/.npm/findup-sync/0.1.3/package/package.json'
npm ERR! { [Error: EACCES, open '/Users/Jasper/.npm/findup-sync/0.1.3/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/Jasper/.npm/findup-sync/0.1.3/package/package.json',
npm ERR! parent: 'load-grunt-tasks' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/Jasper/Sites/test
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/Jasper/.npm/findup-sync/0.1.3/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/Jasper/.npm/findup-sync/0.1.3/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Jasper/Sites/test/npm-debug.log
npm ERR! not ok code 0
I've tried to update node-gyp, uninstalled node and reinstalled via homebrew but with no success...
if I install the generator with sudo, running yo angular returns the following
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "karma-phantomjs-launcher" "karma-jasmine" "grunt-karma" "--save-dev"
npm ERR! cwd /Users/Jasper/.npm/lodash/2.4.1/package
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/Jasper/.npm/mkdirp/0.3.5/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/Jasper/.npm/mkdirp/0.3.5/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Jasper/.npm/lodash/2.4.1/package/npm-debug.log
npm ERR! not ok code 0
Don't see why this isn't working, as I had it working before
I'm on a clean install of OSX Mavericks
Jasper
I had a similar issue. Get started with fixing the permissions issue:
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
It's a popular issue: npm throws error without sudo
Related
Node: 12.6.0,
Npm:6.10.1,
Ubuntu: 19.04
I got this huge error when I run
npm i <package-name> Error Link https://textsaver.flap.tv/lists/2s4g
When I include sudo sudo i <package-name> I got this error
usama#usama:~/Learn/back-end/advance-nodejs/section two$ sudo npm i webworker-threads
> webworker-threads#0.7.17 install /home/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads/build'
gyp ERR! System Linux 5.0.0-20-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v5.0.2
gyp ERR! not ok
npm WARN section-two#1.0.0 No description
npm WARN section-two#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webworker-threads#0.7.17 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webworker-threads#0.7.17 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! /home/usama/.npm/_logs/2019-07-13T15_25_15_922Z-debug.log
usama#usama:~/Learn/back-end/advance-nodejs/section two$
Using yarn instead of npm solve the issue.
after installed the nvm,I ready to install the node,but when I print the code:"nvm install node && nvm alias default node",it results in "Version 'node' not found - try nvm ls-remote to browse available versions."
lotusdeMacBook-Pro:~ hfr$ nvm install node && nvm alias default node
Version 'node' not found - try `nvm ls-remote` to browse available versions.
actually,my Mac has installed the node in another way, but then I can't install react-native-cli. The problems is:
lotusdeMacBook-Pro:~ hfr$ npm install -g react-native-cli
npm WARN engine react-native-cli#0.1.10: wanted: {"node":">=4"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/react-native-cli'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/react-native-cli']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/react-native-cli',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/react-native-cli',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "react-native-cli"
npm ERR! cwd /Users/hfr
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/lib/node_modules/react-native-cli
npm ERR! fstream_path /usr/local/lib/node_modules/react-native-cli
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/react-native-cli'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/hfr/npm-debug.log
npm ERR! not ok code 0
I don't know why. I need your help,thanks ahead.
Try nvm install v5.6.0 && nvm alias default v5.6.0.
The node in the nvm docs is a placeholder for a node version.
Regarding your other node installation, you should probably uninstall it, when you have no other use for it, as it is outdated.
I have not been able to successfully install ember-cli. I finally was able to run:
sudo npm install -g ember-cli
But when running:
user#host:~ ember new ember-app
I get:
/usr/bin/env: node: No such file or directory
I installed node.js from the repositories using sudo apt-get install nodejs and same with npm.
I have installed bower and tried to re-install npm. Here is the last error:
user#host:~ npm install -g ember-cli
npm http GET https://registry.npmjs.org/ember-cli
npm http 200 https://registry.npmjs.org/ember-cli
npm http GET https://registry.npmjs.org/ember-cli/-/ember-cli-0.2.7.tgz
npm http 200 https://registry.npmjs.org/ember-cli/-/ember-cli-0.2.7.tgz
npm ERR! Error: shasum check failed for /home/user/tmp/npm-14461-xfhNCJKF/1435776262780-0.6301117099355906/tmp.tgz
npm ERR! Expected: fefcd9fe7faf276a5a68c8bfcc92288c0f0678d5
npm ERR! Actual: c120ca4196f11da6e51f9c8ebb273439dcfee615
npm ERR! at /usr/lib/nodejs/sha/index.js:38:8
npm ERR! at ReadStream.<anonymous> (/usr/lib/nodejs/sha/index.js:85:7)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
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 3.13.0-55-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "ember-cli"
npm ERR! cwd /home/user
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user/npm-debug.log
npm ERR! not ok code 0
For clarity, I am able to install other items using npm. Just not ember-cli.
UPDATE:
I am getting similar errors that I've received in previous executions of npm install -g ember-cli when run the following:
npm install -g latest-version
Received the following error:
npm http GET https://registry.npmjs.org/latest-version
npm http 304 https://registry.npmjs.org/latest-version
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/latest-version'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/latest-version']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/latest-version',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/latest-version',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/nodejs/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/nodejs/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-55-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "latest-version"
npm ERR! cwd /home/user
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/latest-version
npm ERR! fstream_path /usr/local/lib/node_modules/latest-version
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/latest-version'
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user/npm-debug.log
npm ERR! not ok code 0
-
UPDATE:
"Fix" is in the comment below.
For your node issue, try the following command which will make it so your system recognizes your node.js directory as node:
sudo ln -s /usr/bin/nodejs /usr/bin/node
Regarding the issue with administrator access, simply run your commands with sudo at the beginning. Sudo is usually required in situations where modifications to the filesystem are necessary.
I'm confused by this problem
My OS is
CentOS 7
my account can exec sudo
I download the nodejs node-v0.10.31-linux-x64.tar.gz for 64-bit linux from the official nodejs site and put it under the /usr/tools, unzip the file and then put the node path to PATH, the npm and node exec file is in the folder /usr/tools/node-v10/bin
the result like
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/lawrence/bin:/usr/tools/node-v10/bin
I exec the command:
sudo npm install -g bower or the sudo npm install bower
the error occurs:
sudo: npm: command not found
and when exec the command:
npm install -g bower or the npm install bower
the error occurs like:
npm ERR! Error: EACCES, mkdir '/usr/tools/node-v10/lib/node_modules/bower'
npm ERR! { [Error: EACCES, mkdir '/usr/tools/node-v10/lib/node_modules/bower']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/tools/node-v10/lib/node_modules/bower',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/tools/node-v10/lib/node_modules/bower',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/tools/node-v10/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/tools/node-v10/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.10.0-123.6.3.el7.x86_64
npm ERR! command "/usr/tools/node-v10/bin/node" "/usr/tools/node-v10/bin/npm" "install" "bower" "-g"
npm ERR! cwd /usr/tools/node-v10/bin
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /usr/tools/node-v10/lib/node_modules/bower
npm ERR! fstream_path /usr/tools/node-v10/lib/node_modules/bower
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/tools/node-v10/lib/node_modules/bower'
npm ERR! fstream_stack /usr/tools/node-v10/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/tools/node-v10/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.10.0-123.6.3.el7.x86_64
npm ERR! command "/usr/tools/node-v10/bin/node" "/usr/tools/node-v10/bin/npm" "install" "bower" "-g"
npm ERR! cwd /usr/tools/node-v10/bin
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/tools/node-v10/bin/npm-debug.log
npm ERR! not ok code 0
I am new to node. Can someone please tell me why this is failing?
sudo su
nvm use 0.10
git clone https://github.com/bitpay/insight.git && cd insight
npm install
...output omitted...
> leveldown#0.10.2 install /insight/node_modules/insight-bitcore-api/node_modules/leveldown
> node-gyp rebuild
gyp: Call to 'node -e "require('nan')"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.11.0-19-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /insight/node_modules/insight-bitcore-api/node_modules/leveldown
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
...
npm ERR! Error: ENOENT, lstat '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat'
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 Linux 3.11.0-19-generic
npm ERR! command "/root/.nvm/v0.10.26/bin/node" "/root/.nvm/v0.10.26/bin/npm" "install"
npm ERR! cwd /insight
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat
npm ERR! fstream_path /insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /root/.nvm/v0.10.26/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process'
npm ERR! error rolling back insight-bitcore-api#0.1.9 { [Error: ENOTEMPTY, rmdir '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process' }
npm ERR! leveldown#0.10.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown#0.10.2 install script.
npm ERR! This is most likely a problem with the leveldown package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls leveldown
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-19-generic
npm ERR! command "/root/.nvm/v0.10.26/bin/node" "/root/.nvm/v0.10.26/bin/npm" "install"
npm ERR! cwd /insight
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
Any insight into this is appreciated! I'm only listing the first ERR blocks...
This line:
/bin/sh: 1: node: not found
leads me to believe node isn't properly installed.. What happens when you type 'node' on a command line?
You need to have nodejs to be accessible with node in the command line.
But: In the Ubuntu repos there is a confusion/conflict between nodejs and ax25-node, the latter occupying the /usr/bin/node path. When you never installed node aka ax25-node you can simply
sudo aptitude install nodejs-legacy
This installs nodejs and creates a symbolic link to /usr/bin/node.
Now npm installs run without any error messages.
In my case the same error as yours appeared when trying to
npm install -g Haraka
The solution is from a fairly unrelated stackoverflow post:
nodejs vs node on ubuntu 12.04
I ran npm install node (even though it was already installed to some degree) and the issue was resolved.