WebStorm - error: Please specify npm package

后端 未结 12 2285
忘掉有多难
忘掉有多难 2020-12-29 06:53

Webstorm throws an error when trying to run a command specified in package.json:

\"devDependencies\": {},
      \"scripts\": {
        \"dev\": \"./node_modu         


        
相关标签:
12条回答
  • 2020-12-29 07:09

    Try changing your NPM patch no /usr/share/npm. This works for me.

    0 讨论(0)
  • 2020-12-29 07:10

    I have fixed this problem by update the latest version of nodejs

    0 讨论(0)
  • 2020-12-29 07:11

    if you use Node Version Manager like me, it was a folder in which the bin folder was:

    ~/.nvm/versions/node/v8.9.1/lib/node_modules/npm
    
    0 讨论(0)
  • 2020-12-29 07:14

    Just update Webstorm to 2018.3. Problem solved

    0 讨论(0)
  • 2020-12-29 07:16

    On Ubuntu, if you have installed npm/nodejs via apt, use the /usr/share/npm folder for the npm package.

    sudo apt-get install npm nodejs
    sudo ln -s /usr/bin/nodejs /usr/bin/node
    
    0 讨论(0)
  • 2020-12-29 07:20

    In Linux/Ubuntu: One of the reasons why webstorm throws this error is because of false directory names for node interpreter ("Run > Edit configurations > Defaults> npm > node interpreter").

    In the recent node installation the default node interpreter directory is usr/bin/nodejs instead of usr/bin/node.

    So, correct the node interpreter from "usr/bin/node" to "usr/bin/nodejs" and it works fine.

    0 讨论(0)
提交回复
热议问题