“npm start”不适用于我的创建反应应用程序应用程序.缺少模板



我通常只是为我的创建-反应-应用程序项目运行npm start,但在重新启动计算机后,我无法再这样做并得到这个奇怪的错误:

module.js:341
    throw err;
    ^
Error: Cannot find module './Template'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/richardbustos/Google Drive/workspace/portfolio/node_modules/webpack/lib/MainTemplate.js:8:16)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.5.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! portfolio@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portfolio@0.1.0 start script 'react-scripts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the portfolio package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs portfolio
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls portfolio
npm ERR! There is likely additional logging output above.

我尝试运行npm install并更新 npm 和 npde,但没有任何效果

啊找到了

解决方法。我所要做的就是:

rm -rf node_module

清洁然后运行

npm install

这似乎有效=(

我在运行 npm start 命令时遇到了同样的问题。

安装 npm 版本 4.6.1 帮助我解决了这个问题。我希望这对你们中的一些人有所帮助。

最新更新