简体   繁体   中英

Angular2/4 Module build failed: Error

I'm using Angular2-webpack-starter . I need to move all these sources (except the package.json file) to frontend_src folder. I did it, I replaced all paths within the project but when I'm trying the npm start command (after npm install of course) I'm getting this (I replaced path to project with the {{project_path}} here, the path is correct):

ERROR in ./frontend_src/src/main.browser.ts
Module build failed: Error
    at new FatalError (D:\{{project_path}}\node_modules\tslint\lib\error.js:31:23)
    at Function.findConfiguration (D:\{{project_path}}\node_modules\tslint\lib\configuration.js:55:15)
    at parseConfigFile (D:\{{project_path}}\node_modules\tslint-loader\index.js:44:24)
    at resolveOptions (D:\{{project_path}}\node_modules\tslint-loader\index.js:35:27)
    at Object.module.exports (D:\{{project_path}}\node_modules\tslint-loader\index.js:139:17)
 @ multi (webpack)-dev-server/client?http://localhost:3000 ./frontend_src/src/main.browser.ts

ERROR in ./frontend_src/src/polyfills.browser.ts
Module build failed: Error
    at new FatalError (D:\{{project_path}}\node_modules\tslint\lib\error.js:31:23)
    at Function.findConfiguration (D:\{{project_path}}\node_modules\tslint\lib\configuration.js:55:15)
    at parseConfigFile (D:\{{project_path}}\node_modules\tslint-loader\index.js:44:24)
    at resolveOptions (D:\{{project_path}}\node_modules\tslint-loader\index.js:35:27)
    at Object.module.exports (D:\{{project_path}}\node_modules\tslint-loader\index.js:139:17)
 @ multi (webpack)-dev-server/client?http://localhost:3000 ./frontend_src/src/polyfills.browser.ts

How you can see, there is no explanation where is the problem. I tried to google it but all similar issues have the explanation why compilation was failed. I tried the clean install and npm cache clean --force command.

Can someone tell me where is the problem?

It is probably because you have also moved tslint.json into your client folder. You could move it back to where it was (usually at root of your project work-folder), or create a new mini tslint.json there with

{
    "extends": "./node_modules/shared_library/tslint.json"
}

You may also checkout issue here: https://github.com/wbuchwalter/tslint-loader/issues/57

as well as https://github.com/wbuchwalter/tslint-loader/issues/22

I tried specify configFile Option in webpack config, but it does not seem working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM