我从ionic2 beta 11更新为rc0。 在使用rc0创建一个新项目后,所有内容都在测试版11上,我收到了以下错误:
[12:35:30] bundle prod started ...
[12:35:30] Error: Could not resolve entry (.tmp/app/main.prod.js)
at /Users/MAC/myapp/node_modules/rollup/dist/rollup.js:8602:28
at process._tickCallback (internal/process/next_tick.js:103:7)
[12:35:30] sass started ...
[12:35:32] sass finished in 2.28 s
[12:35:32] minify started ...
[12:35:32] cleancss started ...
[12:35:32] uglifyjs started ...
[12:35:32] Error: ENOENT: no such file or directory, open '/Users/MAC/myapp/www/build/main.js'
at Error (native)
at Object.fs.openSync (fs.js:634:18)
at Object.fs.readFileSync (fs.js:502:33)
at addFile (/Users/MAC/myapp/node_modules/uglify-js/tools/node.js:68:22)
at /Users/MAC/myapp/node_modules/uglify-js/tools/node.js:79:17
at Array.forEach (native)
at Object.exports.minify (/Users/MAC/myapp/node_modules/uglify-js/tools/node.js:77:26)
at runUglifyInternal (/Users/MAC/myapp/node_modules/@ionic/app-scripts/dist/uglifyjs.js:34:19)
at runUglify (/Users/MAC/myapp/node_modules/@ionic/app-scripts/dist/uglifyjs.js:23:28)
at Object.uglifyjs (/Users/MAC/myapp/node_modules/@ionic/app-scripts/dist/uglifyjs.js:9:12)
我注意到问题是没有创建main.js文件。 谢谢
我在safari web开发者中遇到了这个错误:
Failed to load resource: The requested URL was not found on this server.
file:///var/containers/Bundle/Application/12824002-C5CC-42CD-8173-4A472DC68C9E/myapp.app/www/build/main.js
main.prod.js的内容是:
import { platformBrowser } from '@angular/platform-browser';
import { enableProdMode } from '@angular/core';
import { AppModuleNgFactory } from './app.module.ngfactory';
enableProdMode();
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
谢谢
答案 0 :(得分:0)
我通过重新安装东西来解决它。
$ npm install ionic@latest -g
$ npm install @ionic/app-scripts@latest --save-dev
您也可以参考this discussion