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

windows 10 下编译问题 #543

Closed
echofool opened this issue Jun 14, 2018 · 3 comments
Closed

windows 10 下编译问题 #543

echofool opened this issue Jun 14, 2018 · 3 comments

Comments

@echofool
Copy link

echofool commented Jun 14, 2018

$ npm -v 
5.6.0
$ npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
$ npm run build

> art-template@4.12.2 build D:\projects\github\aui\art-template
> npm run build-lib && npm run build-web


> art-template@4.12.2 build-lib D:\projects\github\aui\art-template
> rm -rf lib && babel src --out-dir lib --presets=es2015-loose

resolve failed for "babel-runtime": Error: Cannot find module 'babel-runtime'
src\compile\adapter\caches.js -> lib\compile\adapter\caches.js
src\compile\adapter\extend.js -> lib\compile\adapter\extend.js
src\compile\adapter\html-minifier.js -> lib\compile\adapter\html-minifier.js
src\compile\adapter\include.js -> lib\compile\adapter\include.js
src\compile\adapter\loader.js -> lib\compile\adapter\loader.js
src\compile\adapter\onerror.js -> lib\compile\adapter\onerror.js
src\compile\adapter\resolve-filename.js -> lib\compile\adapter\resolve-filename.js
src\compile\adapter\rule.art.js -> lib\compile\adapter\rule.art.js
src\compile\adapter\rule.native.js -> lib\compile\adapter\rule.native.js
src\compile\compiler.js -> lib\compile\compiler.js
src\compile\defaults.js -> lib\compile\defaults.js
src\compile\error.js -> lib\compile\error.js
src\compile\es-tokenizer.js -> lib\compile\es-tokenizer.js
src\compile\index.js -> lib\compile\index.js
src\compile\runtime.js -> lib\compile\runtime.js
src\compile\tpl-tokenizer.js -> lib\compile\tpl-tokenizer.js
src\defaults.js -> lib\defaults.js
src\extension.js -> lib\extension.js
src\index.js -> lib\index.js
src\precompile.js -> lib\precompile.js
src\render.js -> lib\render.js
src\runtime.js -> lib\runtime.js

> art-template@4.12.2 build-web D:\projects\github\aui\art-template
> export NODE_ENV=production && webpack

'export' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! art-template@4.12.2 build-web: `export NODE_ENV=production && webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the art-template@4.12.2 build-web script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\echofool\AppData\Roaming\npm-cache\_logs\2018-06-14T05_08_17_562Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! art-template@4.12.2 build: `npm run build-lib && npm run build-web`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the art-template@4.12.2 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\echofool\AppData\Roaming\npm-cache\_logs\2018-06-14T05_08_17_598Z-debug.log

以上是在 git-bash 下执行的情况,麻烦 @aui 帮忙看一下。

@aui
Copy link
Owner

aui commented Jun 14, 2018

package.json 中的 scripts 使用了 export 设置环境变量,只有 macOS 与 Linux 支持。你可以将 export 改成 Windows 支持的命令

@echofool
Copy link
Author

谢谢答复,我已经尝试将 export 改成了 set,确实可以编译了,编译过程中还是有一个问题没有解决。
resolve failed for "babel-runtime": Error: Cannot find module 'babel-runtime'
不过能编译,编译出来的 template-web.js 不是压缩版本,我还在找原因。

@echofool
Copy link
Author

echofool commented Jun 14, 2018

webpack.config.js 来看是环境变量没有设置成功。
我已经把 package.json "script" 节点的 export 改成了 set

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

2 participants