baidu / NoahV

An efficient front-end application framework based on vue.js
https://baidu.github.io/NoahV
Apache License 2.0
639 stars 146 forks source link

Bug: if a project under `src` directory, noahv start failed. #62

Closed deancn closed 4 years ago

deancn commented 4 years ago

mkdir -p src/projectname cd src/projectname noahv init then noahv start failed, error log as follow.

bug maybe at https://github.com/baidu/NoahV/blob/master/template/common/scripts/webpack.base.conf.js#L65

Error log( b as project name): ERROR in ./node_modules/css-loader/dist/runtime/url-escape.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Couldn't find preset "@babel/preset-env" relative to directory "/private/tmp/src/b/node_modules/css-loader" at /private/tmp/src/b/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19 at Array.map () at OptionManager.resolvePresets (/private/tmp/src/b/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20) at OptionManager.mergePresets (/private/tmp/src/b/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10) at OptionManager.mergeOptions (/private/tmp/src/b/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14) at OptionManager.init (/private/tmp/src/b/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12) at File.initOptions (/private/tmp/src/b/node_modules/babel-core/lib/transformation/file/index.js:212:65) at new File (/private/tmp/src/b/node_modules/babel-core/lib/transformation/file/index.js:135:24) at Pipeline.transform (/private/tmp/src/b/node_modules/babel-core/lib/transformation/pipeline.js:46:16) at transpile (/private/tmp/src/b/node_modules/babel-loader/lib/index.js:50:20) at /private/tmp/src/b/node_modules/babel-loader/lib/fs-cache.js:118:18 at ReadFileContext.callback (/private/tmp/src/b/node_modules/babel-loader/lib/fs-cache.js:31:21) at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:239:13) @ ./src/common/assets/css/main.less (./node_modules/css-loader/dist/cjs.js??ref--3-1!./node_modules/less-loader/dist/cjs.js??ref--3-2!./src/common/assets/css/main.less) 13:16-89 @ ./src/common/assets/css/main.less @ ./src/main.js @ multi ./scripts/dev-client ./src/main.js

iyuxy commented 4 years ago

Hello,can you try to provide a pull request to fix this?

iyuxy commented 4 years ago

Solved

deancn commented 4 years ago

If you want to fix your project which creates before Dec 13, 2019.
You can replace scripts/webpack.base.conf.js

curl https://raw.githubusercontent.com/baidu/NoahV/master/template/common/scripts/webpack.base.conf.js -o scripts/webpack.base.conf.js