我找不到答案。
ERROR in ./node_modules/ngx-toastr/fesm5/ngx-toastr.js
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/animations' in '/Users/vasanthan/Mean projects/MEAN-Library/node_modules/ngx-toastr/fesm5'
ERROR in ./node_modules/ngx-toastr/fesm5/ngx-toastr.js
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/common' in '/Users/vasanthan/Mean projects/MEAN-Library/node_modules/ngx-toastr/fesm5'
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/common/http' in '/Users/vasanthan/Mean projects/MEAN-Library/src/app'
ERROR in ./node_modules/ngx-toastr/fesm5/ngx-toastr.js
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/core' in '/Users/vasanthan/Mean projects/MEAN-Library/node_modules/ngx-toastr/fesm5'
ERROR in ./src/main.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/core' in '/Users/vasanthan/Mean projects/MEAN-Library/src'
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/core' in '/Users/vasanthan/Mean projects/MEAN-Library/src/app'
ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/core' in '/Users/vasanthan/Mean projects/MEAN-Library/src/app'
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/http' in '/Users/vasanthan/Mean projects/MEAN-Library/src/app'
ERROR in ./node_modules/ngx-toastr/fesm5/ngx-toastr.js
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/platform-browser' in '/Users/vasanthan/Mean projects/MEAN-Library/node_modules/ngx-toastr/fesm5'
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/platform-browser' in '/Users/vasanthan/Mean projects/MEAN-Library/src/app'
ERROR in ./src/main.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/platform-browser-dynamic' in '/Users/vasanthan/Mean projects/MEAN-Library/src'
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/platform-browser/animations' in '/Users/vasanthan/Mean projects/MEAN-Library/src/app'
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/router' in '/Users/vasanthan/Mean projects/MEAN-Library/src/app'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! library@0.0.0 start: `ng build && node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the library@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/vasanthan/.npm/_logs/2018-09-02T15_52_34_108Z-debug.log
4条答案
按热度按时间qoefvg9y1#
您是否在应用程序的根目录下运行过
yarn install
?看起来您在node_modules
文件夹中没有任何依赖项。否则,你需要提供更多的信息。你使用的是Angular CLI吗?看起来你缺少了所有的@Angular 依赖项。
oaxa6hgo2#
运行此命令:
dy1byipe3#
手动删除节点模块文件夹
运行
npm cache clean --force
并运行
npm install
s71maibg4#
如果有人正在使用ngx-toaster和Angular 15以及Visual Studio代码,请确保在从“ngx-toastr”导入包时
默认情况下,Visual Studio代码可从以下位置导入: