简体   繁体   中英

Node / NPM issues installing / upgrading packages OSX Mavericks

I was running node and npm absolutely fine, till today. I am trying to install gulp.

sudo npm install -g gulp and I get a crazy list of errors.

I have tried to re-install node via the Mackintosh Installer, however no difference. Not sure what I was running before the re-install, but now I am running latest stable versions of node and npm.

The same happens if I try to install any node packages. Any suggestions?

ahm:www ahmet$ node -v
v0.10.29
ahm:www ahmet$ npm -v
1.4.14

ahm:www ahmet$ sudo npm install -g gulp
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.keys/node_modules/lodash._isnative'
npm ERR! error rolling back  gulp-util@2.2.19 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.keys/node_modules/lodash._isnative']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.keys/node_modules/lodash._isnative' }
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash'
npm ERR! error rolling back  gulp@3.8.5 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash' }
npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/multipipe/node_modules/duplexer2/node_modules/readable-stream/package.json'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/multipipe/node_modules/duplexer2/node_modules/readable-stream/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/glob/README.md'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/glob/README.md
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/glob/README.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/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: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/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: ENOENT, chown '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/Gruntfile.js'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/Gruntfile.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/Gruntfile.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chown
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._reunescapedhtml/LICENSE.txt'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._reunescapedhtml/LICENSE.txt
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._reunescapedhtml/LICENSE.txt
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/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: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._escapehtmlchar/LICENSE.txt'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._escapehtmlchar/LICENSE.txt
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._escapehtmlchar/LICENSE.txt
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/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: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/glob/glob.js'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/glob/glob.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/glob/glob.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/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: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/minimatch/minimatch.js'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/minimatch/minimatch.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/minimatch/minimatch.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/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 '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys'
npm ERR! error rolling back  vinyl-fs@0.3.4 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys' }
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/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: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash/lodash.js'
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" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash/lodash.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash/lodash.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at process.addListener (events.js:160:15)
    at process.on.process.addListener (node.js:773:26)
    at spinner (/usr/local/lib/node_modules/npm/node_modules/char-spinner/spin.js:35:13)
    at Object.npm.spinner.start (/usr/local/lib/node_modules/npm/lib/npm.js:172:25)
    at Object.commandCache.(anonymous function) (/usr/local/lib/node_modules/npm/lib/npm.js:202:19)
    at /usr/local/lib/node_modules/npm/lib/cache.js:289:18
    at c (/usr/local/lib/node_modules/npm/lib/cache.js:129:12)
    at /usr/local/lib/node_modules/npm/lib/cache.js:145:5
    at process._tickCallback (node.js:419:13)

I had to delete my .npm folder, then install npm again to get this working.

sudo rm -rf ~/.npm

sudo npm install -g npm@1.4.14

Once I had done this, I was able to run sudo npm install -g gulp without issue.

I faced similar problem before in my server, it was solved by clearing the npm cache by below commands:

# rm -rf ~/.npm
# npm cache clear

Or you can just clear the physical folder at

C:\Users\{{USERFolder}}\AppData\Roaming\npm-cache

source : http://origin1tech.wordpress.com/2013/08/31/clearing-nodes-npm-cache/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM