Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cnpm i 安装后没有报错, npm start的时候报错了,是不是不支持Angular: 6.0.2 ? #448

Closed
jsjjl opened this issue May 18, 2018 · 7 comments

Comments

@jsjjl
Copy link

jsjjl commented May 18, 2018

ERROR in ./src/styles.less (./node_modules/.0.5.1@raw-loader!./node_modules/.2.1
.5@postcss-loader/lib??embedded!./node_modules/.4.1.0@less-loader/dist/cjs.js??r
ef--15-3!./src/styles.less)
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/routes/passport/login/login.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/routes/passport/register/register.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/routes/dashboard/workplace/workplace.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/routes/dashboard/monitor/monitor.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/routes/dashboard/analysis/analysis.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/layout/passport/passport.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/routes/widgets/widgets/widgets.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/routes/pro/profile/advanced/advanced.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)
ERROR in ./src/app/routes/pro/list/applications/applications.component.less
Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
in node_modules\ng-zorro-antd\src\style\color\bezierEasing.less (line 110,
column 0)

@cipchk
Copy link
Member

cipchk commented May 18, 2018

使用 cnpm 安装依赖包,会遇到无法找到样式文件。这是由于 cnpm 采用的是软链接路径形式,导致 ng-zorro-antd 文件夹名有所变动,因此建议改用 npmyarn 安装依赖包。

目前受限于 angular/angular-cli#10430 ,需要降级less。或者直接使用 ng-alain 提供的 package-lock.json

@cipchk cipchk closed this as completed May 19, 2018
@Z-undefined
Copy link

我用的yarn安装的也报这个错了 是直接clone下来的

@rqx110
Copy link

rqx110 commented Jun 4, 2018

使用yarn 安装报错 +1

@cipchk
Copy link
Member

cipchk commented Jun 4, 2018

@rqx110
Copy link

rqx110 commented Jun 4, 2018

默认git clone过来后,如果用yarn,需要执行 yarn add less@~2.7.0 less-loader@~4.0.0才能运行。为什么不直接兼容yarn呢?
https://ng-alain.com/cli/plugin#yarn 这个文档里也没写怎么来“修复由于降级 Less 导致无法使用 yarn 安装依赖包问题。”

@lumeng689
Copy link

在 node_modules@angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\styles.js line 136和142行
(由于版本不一样文件的位置也不一样),lessPathOptions这个对象,加入属性lessPathOptions.javascriptEnabled = true。

 let lessPathOptions = { paths: [], javascriptEnabled: true};
    if (......);
        lessPathOptions = {
            paths: includePaths,
            javascriptEnabled: true
        };
    }

参考 https://segmentfault.com/a/1190000015577159?_ea=4148303

@cipchk
Copy link
Member

cipchk commented Sep 28, 2018

确保以下版本:

"@angular-devkit/build-angular": "~0.8.0",
"@angular/cli": "~6.2.3",

可以无须再降级 less

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants