angular - Angular 6:使用 npm start 启动我的应用程序时出错
问题描述
我从事 Angular 6 项目已经有很长时间了,当我node_modules
的项目文件夹中有文件夹时,它工作得很好。我希望能够在没有项目node_modules
内部的情况下运行我的项目,因此我将node_modules
文件夹移动到父文件夹并更改angular.json
了以../node_modules
. 我认为它会起作用,但是在我写 npm start 之后我得到了这个错误:
pm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! lg-academy@0.0.0 start: `ng serve --configuration=production --host 0.0.0.0 --port 4200 --verbose --disable-host-check`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the lg-academy@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ofir/.npm/_logs/2018-11-15T1
预先感谢所有帮助者
解决方案
在我在这里和谷歌上得到答案并询问了我的一些朋友之后,我刚刚部署了所有内容并将 node_modules 返回到我的项目文件夹。部署它需要很多时间,但没有其他方法。
感谢您的意见和帮助!
推荐阅读
- elasticsearch - Logstash 异常:读取 csv 文件时出现 Errno::EACCES
- javascript - 即使等待,Mongoose 也会返回 undefined。任何猜测可能是错误的?
- python - 命令错误退出状态 1:Python setup.py [...] 尝试安装 Pysam 时
- python - Pandas:在应用逐行函数时将一行拆分为两行或多行
- reactjs - 为什么 jest 不调用 useEffect 挂钩内的函数?
- java - 我应该为我的库存系统使用静态列表吗?
- react-redux - 从其他操作调用操作
- python - 使用 tqdm 在 python 中制作多个进度条
- javascript - Angular 9(常春藤):从选择器获取组件类
- python - 无法从 models.py 获取菜单项的 url