question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't install with npm

See original GitHub issue

When I run npm install forever, the last chunk of output shows a bunch of npm ERR! Error: ENOENT messages, among others, and the installation fails.

Here is the full terminal output:

npm http GET https://registry.npmjs.org/forever
npm http 304 https://registry.npmjs.org/forever
npm http GET https://registry.npmjs.org/broadway
npm http GET https://registry.npmjs.org/cliff
npm http GET https://registry.npmjs.org/daemon
npm http GET https://registry.npmjs.org/flatiron
npm http GET https://registry.npmjs.org/microtime
npm http GET https://registry.npmjs.org/nconf
npm http GET https://registry.npmjs.org/nssocket
npm http GET https://registry.npmjs.org/node-fork
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/portfinder
npm http GET https://registry.npmjs.org/ps-tree
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/timespan
npm http GET https://registry.npmjs.org/watch
npm http GET https://registry.npmjs.org/utile
npm http GET https://registry.npmjs.org/winston
npm http 304 https://registry.npmjs.org/broadway
npm http 304 https://registry.npmjs.org/cliff
npm http 304 https://registry.npmjs.org/flatiron
npm http 304 https://registry.npmjs.org/daemon
npm http 304 https://registry.npmjs.org/nconf
npm http 304 https://registry.npmjs.org/microtime
npm http 304 https://registry.npmjs.org/nssocket
npm http 304 https://registry.npmjs.org/node-fork
npm http 304 https://registry.npmjs.org/pkginfo
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/portfinder
npm http 304 https://registry.npmjs.org/ps-tree
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/watch
npm http 304 https://registry.npmjs.org/timespan
npm http 304 https://registry.npmjs.org/utile
npm http 304 https://registry.npmjs.org/winston
npm http GET https://registry.npmjs.org/parse-table

> microtime@0.2.0 install /Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/microtime
> node-waf configure build

npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/lru-cache

> daemon@0.4.1 preinstall /Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/daemon
> bash ./install

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /usr/local/lib/node 
Checking for node prefix                 : ok /usr/local/Cellar/node/0.6.11 
'configure' finished successfully (0.054s)
Waf: Entering directory `/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/microtime/build'
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/ncp
npm http GET https://registry.npmjs.org/rimraf
[1/2] cxx: src/microtime.cc -> build/Release/src/microtime_1.o
npm http GET https://registry.npmjs.org/async
Checking for program g++ or c++          : /usr/bin/g++ 
npm http GET https://registry.npmjs.org/lazy
npm http GET https://registry.npmjs.org/eventemitter2
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /usr/local/lib/node 
Checking for node prefix                 : ok /usr/local/Cellar/node/0.6.11 
'configure' finished successfully (0.058s)
Waf: Entering directory `/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/daemon/build'
[1/2] cxx: src/daemon.cc -> build/Release/src/daemon_1.o

> node-fork@0.4.2 preinstall /Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/node-fork
> bash ./install

npm http GET https://registry.npmjs.org/wordwrap
[2/2] cxx_link: build/Release/src/microtime_1.o -> build/Release/microtime.node
Waf: Leaving directory `/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/microtime/build'
'build' finished successfully (0.344s)
npm http GET https://registry.npmjs.org/optimist/0.3.1
npm http GET https://registry.npmjs.org/prompt/0.1.12
npm http GET https://registry.npmjs.org/director/1.0.9-1
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
npm http 304 https://registry.npmjs.org/parse-table
Checking for g++                         : ok  
Checking for node path                   : ok /usr/local/lib/node 
Checking for node prefix                 : ok /usr/local/Cellar/node/0.6.11 
[2/2] cxx_link: build/Release/src/daemon_1.o -> build/Release/daemon.node
npm http GET https://registry.npmjs.org/eventemitter2/0.4.8
npm http GET https://registry.npmjs.org/colors/0.6.0-1
'configure' finished successfully (0.073s)
npm http 304 https://registry.npmjs.org/mkdirp
Waf: Entering directory `/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/node-fork/build'
Waf: Leaving directory `/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/daemon/build'
'build' finished successfully (0.367s)
[1/2] cxx: src/createpair.cc -> build/Release/src/createpair_1.o
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/event-stream
npm http 304 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/eyes
npm http 304 https://registry.npmjs.org/lazy
npm http 304 https://registry.npmjs.org/eventemitter2
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/ncp
[2/2] cxx_link: build/Release/src/createpair_1.o -> build/Release/createpair.node
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/optimist/0.3.1
Waf: Leaving directory `/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/node-fork/build'
'build' finished successfully (0.272s)
npm http 304 https://registry.npmjs.org/prompt/0.1.12
npm http 304 https://registry.npmjs.org/director/1.0.9-1
npm http 304 https://registry.npmjs.org/eventemitter2/0.4.8
npm ERR! error installing prompt@0.1.12
npm ERR! error installing flatiron@0.1.14

npm ERR! Error: ENOENT, no such file or directory '/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/flatiron/node_modules/___optimist.npm/package/examples/boolean_single.js'
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 Darwin 10.7.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/viatropos/Desktop/tw/abb
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.1
npm ERR! path /Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/flatiron/node_modules/___optimist.npm/package/examples/boolean_single.js
npm ERR! fstream_path /Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/flatiron/node_modules/___optimist.npm/package/examples/boolean_single.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory '/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/flatiron/node_modules/___optimist.npm/package/examples/boolean_single.js'
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:204:26)
npm http 304 https://registry.npmjs.org/eyes
npm http 304 https://registry.npmjs.org/colors/0.6.0-1
npm http 304 https://registry.npmjs.org/event-stream
npm http 304 https://registry.npmjs.org/colors
npm ERR! error rolling back flatiron@0.1.14 Error: UNKNOWN, unknown error '/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/flatiron/node_modules/___director.npm/package'
npm ERR! error installing forever@0.8.5
npm WARN eyes@0.1.7 dependencies field should be hash of <name>:<version-range> pairs

npm ERR! Error: ENOENT, no such file or directory '/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/utile/node_modules/___ncp.npm/package/package.json'
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 Darwin 10.7.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/viatropos/Desktop/tw/abb
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.1
npm ERR! path /Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/utile/node_modules/___ncp.npm/package/package.json
npm ERR! fstream_path /Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/utile/node_modules/___ncp.npm/package/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call utimes
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory '/Users/viatropos/Desktop/tw/abb/node_modules/forever/node_modules/utile/node_modules/___ncp.npm/package/package.json'
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:285:17)
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/viatropos/Desktop/tw/abb/npm-debug.log
npm not ok

The npm-debug.log looks like this:

info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'forever' ]
info using npm@1.1.1
info using node@v0.6.11
verbose /usr/local/bin/node node symlink
verbose config file /Users/viatropos/.npmrc
verbose config file /usr/local/etc/npmrc
verbose config file /usr/local/lib/node_modules/npm/npmrc
verbose caching /Users/viatropos/Desktop/tw/abb/package.json
verbose loadDefaults abb@0.0.1
verbose from cache /Users/viatropos/Desktop/tw/abb/package.json
verbose cache add [ 'forever', null ]
silly cache add: name, spec, args [ undefined, 'forever', [ 'forever', null ] ]
verbose parsed url { pathname: 'forever', path: 'forever', href: 'forever' }
verbose addNamed [ 'forever', '' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'forever', '', false ]
verbose raw, before any munging forever
verbose url resolving [ 'https://registry.npmjs.org/', './forever' ]
verbose url resolved https://registry.npmjs.org/forever
verbose etag "81UEI747U8TQUP5232RQC4J2B"

Do you know how to fix this?

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:7

github_iconTop GitHub Comments

9reactions
lancejpollardcommented, Mar 3, 2012

It looks like clearing the cache worked!

npm cache clean
1reaction
YoucefMegouracommented, Jun 9, 2020

npm cache verify will fix the problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Npm can't install any packages - node.js - Stack Overflow
If you are a windows user run cmd as administrator and then install packages. It worked for me while installing express via npm....
Read more >
How to fix npm install command not working
The error above happens when npm can't be found under the PATH environment variable. First, you need to make sure that npm is...
Read more >
5 Ways to Fix the Npm Install Not Working Issue
Way 1. Make Sure Npm Is Installed · Way 2. Make Sure There Is a Package.json File · Way 3. Delete Lock File...
Read more >
npm command not found | Career Karma
The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be...
Read more >
Common errors | npm Docs
You are trying to install on a drive that either has no space, or has no permission to write. Free some disk space...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found