Local package.json exists, but node_modules missing

As it does not answer your question but searching vm arguments I stumbled on this page and there seem to be no other. So if you want to pass vm arguments its like so

{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "ddtBatch",
"request": "launch",
"mainClass": "com.something.MyApplication",
"projectName": "MyProject",
"args": "Hello",
"vmArgs": "-Dspring.config.location=./application.properties"
}
]
}

I am trying to start a Redux application I just cloned from a GitHub repository.

0 start: `webpack-dev-server --config ./configs/webpack/webpack.config.development.js`

I tried to run it with the following command

npm start
npm ERR! spawn ENOENT

I am getting this error

> react-redux@1.0.0 start /home/workspace/assignment
> webpack-dev-server --config ./configs/webpack/webpack.config.development.js


sh: 1: webpack-dev-server: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! react-redux@1.0.0 start: `webpack-dev-server --config ./configs/webpack/webpack.config.development.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the react-redux@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?


npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2018-05-15T16_32_44_571Z-debug.log

Any help will be appreciated

214344 次浏览

npm start runs a script that the app maker built for easy starting of the app npm install installs all the packages in package.json

run npm install first

then run npm start

npm ERR! npm ERR! Failed at the react-redux@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

This issue can also raise when you change your system password but not the same updated on your .npmrc file that exist on path C:\Users\user_name, so update your password there too.

npm WARN Local package.json exists, but node_modules missing, did you mean to install?

please check on it and run npm install first and then npm start.

I never had any issues with this project because I had TypeScript installed as a global module. As this project didn't include TypeScript as a dev dependency (and expected it to be installed as global), I had the error when testing in another machine (without TypeScript) and running npm install didn't fix the problem. So I had to include TypeScript as a dev dependency (npm install typescript --save-dev) to solve the problem.

I run vscode from my command line by navigating to the folder with the code and running

code .

Use npm install to install the package. I was having a permission issue with running this, due to the closed-nature of my office VPN. This'll solve permission problems...

sudo npm install

If you do that all your bash/zsh variables are passed into vs code. You can update your .bashrc/.zshrc file or just do

export KEY=value

before opening it.

In some cases with permissions, when this fails, it emits no error message. In that case, you may want to adjust user permissions with either chown or chmod. Other times, though, when it fails, you'll actually see a legit error message...

npm ERR! network tunneling socket could not be established, statusCode=400

adjust user permissions with either chown or chmod. Other times, though, when it fails, you'll actually see a legit error message...

npm ERR! network This is most likely not a problem with npm itself

npm ERR! network tunneling socket could not be established, statusCode=400

npm ERR! network and is related to network connectivity.

Optionally, you can also use the Control Panel -> System properties window to set the variables on a more permanent basis

Hope this helps.