Hey I'm trying to install webpack right now.
I have everything setup, but when I try to run webpack inside my terminal, it searches for the package.json
file in the wrong directory.
So my question is, can I change the path where npm tries to find my package.json
file?
npm ERR! enoent ENOENT: no such file or directory, open '/home/User/package.json
^error message I get after trying to run npm webpack in Terminal
{
"name": "package",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"es6-promise": "^4.1.1",
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
}
^this is the package.json file from my project
Hey I'm trying to install webpack right now.
I have everything setup, but when I try to run webpack inside my terminal, it searches for the package.json
file in the wrong directory.
So my question is, can I change the path where npm tries to find my package.json
file?
npm ERR! enoent ENOENT: no such file or directory, open '/home/User/package.json
^error message I get after trying to run npm webpack in Terminal
{
"name": "package",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"es6-promise": "^4.1.1",
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
}
^this is the package.json file from my project
Share Improve this question edited Dec 26, 2017 at 4:34 KARTHIKEYAN.A 20.2k10 gold badges137 silver badges150 bronze badges asked Dec 24, 2017 at 15:42 SupEldrixSupEldrix 1131 silver badge8 bronze badges1 Answer
Reset to default 5You are in the wrong directory.
Make sure you are in the right folder and then run npm install webpack
.
In your terminal use pwd
to print the current working directory and then ls
to list all the files inside it. If there is no package.json
you can't install anything.