Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install errors for errno -2

I am trying to install npm,but it shows errors below:

   npm ERR! install Couldn't read dependencies
   npm ERR! Darwin 14.5.0
   npm ERR! argv  "/Users/bunniehsieh/.nvm/versions/node/v4.1.0/bin/node" "/Users/bunniehsieh/.nvm/versions/node/v4.1.0/bin/npm" "install"
   npm ERR! node v4.1.0
   npm ERR! npm  v2.14.3
   npm ERR! path /Users/bunniehsieh/package.json
   npm ERR! code ENOPACKAGEJSON
   npm ERR! errno -2
   npm ERR! syscall open

   npm ERR! package.json ENOENT: no such file or directory, open    '/Users/bunniehsieh/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! Please include the following file with any support request:
  npm ERR!     /Users/bunniehsieh/npm-debug.log

and I have tried to uninstall then install again,but it didn't work,please give me some advice or any help,THANKS!!!!!!

like image 818
謝孟穎 Avatar asked Oct 30 '22 18:10

謝孟穎


1 Answers

You have nothing to install.

Npm will look for a file named package.json in the current directory. This file contain various information on a project including dependencies.
You need to create (npm init) or import that file from an existing project.

You can also specify a package to install manually by giving its name to npm:

npm install package_name

Please have a full read of the official documentation

like image 79
Cyrbil Avatar answered Nov 04 '22 09:11

Cyrbil