2017-09-15 55 views
-5

//这是错误日志的详细
0的信息,它的工作,如果有好的 1冗长的CLI结束[ 'C:\ Program Files文件\的NodeJS \ node.exe', 1详细cli'C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ bin \ npm-cli.js', 1 verbose cli'start'] 2 info using [email protected] 3 info using node @ v6.11.3 4详细堆栈错误:缺少脚本:start 运行时的详细堆栈(C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ lib \ run-script.js:151:19) C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ lib \ run-script.js中的详细堆栈:61:5 4详细堆栈在C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:115:5 4 C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:402:5 checkBinReferences_(C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:357:45) 4最后的详细堆栈(C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ read-package- (C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:json \ read-json.js:400:3) 160:5) 4 ReadFileContext上的详细堆栈。 (C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:332:20) 4 ReadFileContext.callback(C:\ Users \ SamiUllahJan \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ graceful-fs \ graceful-fs.js:78:16) FSReqWrap.readFileAfterOpen [as oncomplete](fs.js:367:13)的详细堆栈 5 verbose cwd C:\ Samy \ Code School 6 verbose 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” “开始” 8详细节点v6.11.3 9详细NPM v5.4.2 10错误丢失脚本:启动 11详细出口[1,真]的NodeJS NPM开始给错误

回答

0

当你输入端子

npm start 

NPM会在文件的package.json启动脚本,你没有定义。

更改您的package.json文件,如下图所示(注意脚本属性):

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