在Mac OS X 10.11.3下运行npm start 提示:npm ERR! Darwin 15.3.0

运行npm start
提示错误:

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.7.1
npm ERR! npm  v3.6.0

npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/用户名/snapterest/npm-debug.log
阅读 10k
4 个回答

npm run start 或者 npm run-script start
并且需要在package.json的 scripts 中定义start为字段的命令

你没有写 start 的 script

检查当前目录下的package.json里的"script"下是否存在"start"这个属性。

package.json

{
  "scripts": {
    "start": "echo 'hello world!'"
  }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题