`npm start`不能用于我的create-react-app应用程序。缺少模板?

时间:2017-02-06 05:57:04

标签: reactjs npm npm-install create-react-app

我通常只为我的create-react-app项目运行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,但没有任何效果

2 个答案:

答案 0 :(得分:2)

啊,啊,找到了解决办法。我所要做的就是:

rm -rf node_module

清理然后跑

npm install

这似乎有效=)

答案 1 :(得分:0)

运行npm start命令时遇到相同的问题。

安装npm 4.6.1版可以帮助我解决问题。希望对您中的某些人有帮助。