首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Webpack配置未进入严格模式,不想更改代码

Webpack配置未进入严格模式,不想更改代码
EN

Stack Overflow用户
提问于 2018-01-14 01:09:24
回答 1查看 346关注 0票数 1

我尝试构建BitShares UI https://github.com/bitshares/bitshares-ui的产品webpack

问题是,webpack没有在严格模式下运行,不过我不想更改代码。有没有办法强制在严格模式下解释webpack的配置,这样我就可以避免这个问题?

代码语言:javascript
运行
复制
Step 13/19 : RUN npm run build
 ---> [Warning] Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
 ---> Running in 7cfc6910af6a

 BitShares2-light@2.0.180108 build /build
 cross-env NODE_ENV=production webpack --env.prod

/build/webpack.config.js:70
        let outputDir = env.electron ? "electron" : env.hash ? `hash-history_${baseUrl.replace("/", "")}` : "dist";
        ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at requireConfig (/build/node_modules/webpack/bin/convert-argv.js:97:18)
    at /build/node_modules/webpack/bin/convert-argv.js:104:17
    at Array.forEach (native)

npm ERR! Linux 4.13.0-26-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! BitShares2-light@2.0.180108 build: `cross-env NODE_ENV=production webpack --env.prod`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the BitShares2-light@2.0.180108 build script 'cross-env NODE_ENV=production webpack --env.prod'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the BitShares2-light package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=production webpack --env.prod
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs BitShares2-light
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls BitShares2-light
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /build/web/npm-debug.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1
danielcastaneda@kwan-0080:~/WORK/BitPESO/bitshares-docker/build$ 
EN

回答 1

Stack Overflow用户

发布于 2019-05-16 10:14:39

请检查您的nodejs版本。8+ -UI依赖节点BitShare,版本BitShares为必填项。在Ubuntu和OSX上,安装Node最简单的方法是使用Node版本管理器。要安装NVM for Linux/OSX,只需在终端中复制粘贴以下内容:

代码语言:javascript
运行
复制
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash
nvm install v9
nvm use v9

在此之后运行npm run build

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48242248

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档