npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open '/root/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! System Linux 3.11.0-15-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /root
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /root/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm ERR! not ok code 0
Educated guess: Non root user trying to write to /root folder.
I m also getting the same exception. Any idea of how this can be solved ?
Create package.json file
Running just "npm install" will look for dependencies listed in your package.json. The error you're getting says that you don't have a package.json file set up (or you're in the wrong directory).
If you're trying to install a specific package, you should use 'npm install {package name}'. See here for more info about the command.
Otherwise, you'll need to create a package.json file for your dependencies or go to the right directory and then run 'npm install'.
npm install {package name} is not working for me either.
C:UsershpDocumentsNew folderNew Foldernodejs>npm install formidable
[email protected] ........node_modulesformidable
This is what I get and I'm sure the module I'm trying to install isn't installed.
Navigate to your desired directory..and try this command npm init for creating the package.json file
And then try to install the dependencies..
Make sure your cwd is a pull (or download) of this repo. The dependencies are defined in the root of the repo, which is where you should run npm install.
I know it is old post but I ran into same error when installing npm in my windows machine. I executed npm init under /nodejs as suggested by
C:Program Filesnodejs>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See npm help json for definitive documentation on these fields
and exactly what they do.
Use npm install <pkg> --save afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
name: (nodejs) package.json
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to C:Program Filesnodejspackage.json:
{
"name": "package.json",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"npm": "^2.15.1"
},
"devDependencies": {},
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this ok? (yes) yes
C:Program Filesnodejs>
What exactly are you having trouble with? If you install a new version of nodejs npm should get installed automatically.
hi,i met he same issues, because i set the package,json
"name":"aa bbb"
when i change the name to
"name":"aabbb"
the issues disappear.
i hope it help you!