首页 文章

npm开始在nodejs中给出错误

提问于
浏览
-5

//这些是错误日志详细信息
0信息如果以ok结尾1详细cli ['C:\Program Files\nodejs\node.exe',1 verbose cli 'C:\Users\SamiUllahJan\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',1 verbose cli 'start'] 2 info使用npm@5.4.2 3 info使用node@v6.11.3 4 verbose stack错误:缺少脚本:start 4运行时的详细堆栈(C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ lib \ run-script.js:151:19)4 C:\ Users \ SamiUllahJan \ AppData \ Roaming \下的详细堆栈NPM \ node_modules \ NPM \ lib中\运行的script.js:61:5 4中C详细的堆栈:\用户\ SamiUllahJan \应用程序数据\漫游\ NPM \ node_modules \ NPM \ node_modules \读取包JSON \读JSON . JS:115:5 4中C详细的堆栈:\用户\ SamiUllahJan \应用程序数据\漫游\ NPM \ node_modules \ NPM \ node_modules \读取包JSON \读取json.js:402:5 4在checkBinReferences_详细的堆栈(C :\用户\ SamiUllahJan \应用程序数据\漫游\ NPM \ node_modules \ NPM \ node_modules \读取包JSON \读取json.js:357:45)在最终(C 4详细的堆栈:\用户\ SamiUllahJan \应用程序数据\漫游\ npm \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:400:3)4详细堆栈然后(C:\ Users \ Sa miUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:160:5)4 ReadbileContext的详细堆栈 . (C:\用户\ SamiUllahJan \应用程序数据\漫游\ NPM \ node_modules \ NPM \ node_modules \读取包JSON \读取json.js:332:20)在ReadFileContext.callback(4详细的堆栈C:\用户\ SamiUllahJan \应用程序数据\漫游\ NPM \ node_modules \ NPM \ node_modules \优美-FS \优美-fs.js:78:16)在FSReqWrap.readFileAfterOpen [按的onComplete](fs.js 4详细的堆栈:367:13)5详细CWD C:\ Samy \ Code School 6详细Windows_NT 6.3.9600 7详细argv "C:\Program Files\nodejs\node.exe" "C:\Users\SamiUllahJan\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start" 8详细节点v6.11.3 9详细npm v5.4.2 10错误缺失脚本:start 11 verbose exit [1,true]

1 回答

  • 0

    当您输入终端时

    npm start
    

    npm在package.json文件中查找未定义的启动脚本 .

    将package.json文件更改为这样(注意脚本属性):

    {
      "name": "sample-app",
      "version": "1.0.0",
      "description": "",
      "scripts": {
        "start": "node index.js"
      }
    }
    

相关问题