我正在尝试为Grand Stack Starter构建 starter api ,但每次尝试使用时都会失败npm start
:
>nodemon --exec babel-node src/index.js
[nodemon] 1.18.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `babel-node src/index.js`
'babel-node' is not recognized as an internal or external command,
operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting...
注意,我之前确实运行npm i
过,我可以让其他项目运行(包括 grand-stack-starter 的 UI 项目)。我检查了 node_modules 文件夹,我确实没有这个babel-node
包,但是当我直接安装它时,它失败了:
> babel-node@6.5.3 postinstall [project_path]\api\node_modules\babel-node
> node message.js; sleep 10; exit 1;
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module '[project_path]\api\node_modules\babel-node\message.js;'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:282:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm WARN grand-stack-starter-api@0.0.1 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! babel-node@6.5.3 postinstall: `node message.js; sleep 10; exit 1;`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the babel-node@6.5.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我不知道这是否是我的电脑特有的问题,但任何帮助将不胜感激
机器规格:
- 全新安装 Windows 10 家庭版 1803
- I7-8750H
- NPMv 6.4.1
- Node.js v10.14.2