Cannot find module './models/config'

女生的网名这么多〃 提交于 2019-12-05 15:47:42
Jan Nielsen

When installing Angular CLI, explicitly use the latest version, instead:

Update global Angular CLI

rm -rf node_modules dist tmp
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest

Update project's Angular CLI

npm install --save-dev angular-cli@latest

Update project's configuration files

ng init

and carefully review each difference.

Angular 2 has very recently changed it's build engine from SystemJS to Webpack in it's latest release. Which could be one (amongst other) reasons for this error message (it was for me anyway).

If you want to ensure you use the latest, like discussed on their git page, you can run:

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest //in theory, npm install -g angular-cli should be OK

Now your project is likely still 'setup' to use the previous build system, so it's easier to delete your node_modules, and reinstall:

rm -rf node_modules
npm install

You can verify the installation via:

ng build
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!