更新节点模块后出现构建错误

时间:2017-12-08 04:55:33

标签: javascript node.js angular npm build

Error on fetch for node_modules/angular2-notifications/src/simple-notifications.module.js at file:///D:/GIP/IMAGE PILOT/gipfe/node_modules/angular2-notifications/src/simple-notifications.module.js Loading build/tmp/aot/src/app/app.module.ngfactory.js Loading build\boot-aot.js Error: ENOENT: no such file or directory, open 'D:\GIP\IMAGE PILOT\gipfe\node_modules\angular2-notifications\src\simple-notifications.module.js' [10:13:51] 'build.aot' errored after 52 s [10:13:51] Error in plugin 'run-sequence(bundle-aot)' Message: Error on fetch for node_modules/angular2-notifications/src/simple-notifications.module.js at file:///D:/GIP/IMAGE PILOT/gipfe/node_modules/angular2-notifications/src/simple-notifications.module.js Loading build/tmp/aot/src/app/app.module.ngfactory.js Loading build\boot-aot.js ENOENT: no such file or directory, open 'D:\GIP\IMAGE PILOT\gipfe\node_modules\angular2-notifications\src\simple-notifications.module.js' Details: originalErr: Error: ENOENT: no such file or directory, open 'D:\GIP\IMAGE PILOT\gipfe\node_modules\angular2-notifications\src\simple-notifications.module.js' Stack: Error on fetch for node_modules/angular2-notifications/src/simple-notifications.module.js at file:///D:/GIP/IMAGE PILOT/gipfe/node_modules/angular2-notifications/src/simple-notifications.module.js Loading build/tmp/aot/src/app/app.module.ngfactory.js Loading build\boot-aot.js Error: ENOENT: no such file or directory, open 'D:\GIP\IMAGE PILOT\gipfe\node_modules\angular2-notifications\src\simple-notifications.module.js'

import { SimpleNotificationsModule }                from 'angular2-notifications';
 imports: [
    SharedModule,
    routing,
    ToastModule.forRoot(),
    SimpleNotificationsModule.forRoot(),

当我使用build npm run build.aot 命令时出现此构建错误。我在我的项目中放了 npm install 命令然后我尝试接受构建错误。

请帮我解决这个问题

谢谢。

1 个答案:

答案 0 :(得分:0)

在我安装打字稿版本之前

"typescript": "^2.3.3" // package.json

然后我改变了打字稿版本

"typescript": "2.3.3" //without cap symbol

现在,错误未来,我成功构建了