3
votes

**C:\Users\Abc>npm install -g

npm ERR! addLocal Could not install C:\Users\Abc

npm ERR! Windows_NT 6.1.7601

npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Abc\AppData\Ro aming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g"

npm ERR! node v7.2.1

npm ERR! npm v4.0.5

npm ERR! Cannot read property 'path' of null

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! C:\Users\Abc\npm-debug.log**

i have reinstall node with version 7.2.1 after every time this occurs when i download any package

need suggestion related to null path error

3
which package you are trying to install??kgangadhar
npm install cordova -gPradip
if you are trying with npm install -g obviously you'll get this error because u haven't mentioned any package name.kgangadhar
Yeah I have same problem using it in both ways - with -g at the end and beforeVladyn
it solved my issue: npm set strict-ssl falseuser1855805

3 Answers

2
votes

I ran into this issue while installing gulp My NPM and Node Versions are:

  • node v7.7.4
  • npm v4.1.2

In npm version 4x, https client certificates were made required rather than optional. Details are in their github area. Long story short, what helped for me was running the following command:

 npm config set strict-ssl false

Once this was done, running the command

npm install gulp -g

Worked like a charm for me!

1
votes

If you are working behind proxy, you need to set proxy for nodejs

npm config set proxy http://proxy_host:port 
npm config set https-proxy http://proxy_host:port

Hope it Helps.. :)

0
votes

npm install command is used to install packages.

Reason for your error :

You don't have any package.json in your current working directory.

Also, you didn't provide any package name to install from.

Tips :

Check out https://docs.npmjs.com/cli/install for more details.

Never use -g (install dependency globally unless you intend to).