javascript - Yarn 不会构建项目

标签 javascript node.js windows yarnpkg

我正在查看https://github.com/intoli/remote-browser 。我正在使用 Node 11.5 的 win10 中工作。我以前没有使用过 yarn ,但我按照存储库底部的说明进行操作:

# Clone the repository.
git clone https://github.com/intoli/remote-browser.git
cd remote-browser

# Install the dependencies.
yarn install

# Build the project.
yarn build

# Run the tests.
yarn test

我将构建脚本更改为:

    "build": "Set NODE_ENV=production webpack --config webpack"

如果我理解正确的话应该可以在 Windows 上运行。

但是

$ yarn -v
1.17.3

$ yarn build
yarn run v1.17.3
$ Set NODE_ENV=production webpack --config webpack
Done in 0.31s.

但我没有看到 DST 文件夹添加到根目录。

我做错了什么?

编辑2:

{
  "name": "remote-browser",
  "version": "0.0.15",
  "description": "A low-level browser automation framework built on top of the Web Extensions API standard. ",
  "main": "index.js",
  "repository": "git@github.com:intoli/remote-browser.git",
  "author": "Intoli, LLC <contact@intoli.com>",
  "license": "BSD",
  "scripts": {
    "build": "Set NODE_ENV=production webpack --config webpack",
    "build:web": "NODE_ENV=production webpack --config webpack/web-client.config.js",
    "postversion": "git push && git push --tags",
    "test": "npm run build && NODE_ENV=test mocha --exit --require babel-core/register",
    "test-fast": "NODE_ENV=test mocha --exit --require babel-core/register --invert --grep Browser",
    "watch": "NODE_ENV=development webpack --watch --config webpack"
  },
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-eslint": "^8.0.2",
    "babel-loader": "^7.1.2",
    "babel-plugin-transform-builtin-extend": "^1.1.2",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "clean-webpack-plugin": "^0.1.17",
    "copy-webpack-plugin": "^4.2.1",
    "eslint": "^4.11.0",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-import": "^2.8.0",
    "imports-loader": "^0.7.1",
    "jimp": "^0.2.28",
    "mocha": "^4.0.1",
    "null-loader": "^0.1.1",
    "source-map-support": "^0.5.0",
    "webextension-polyfill": "^0.2.1",
    "webpack": "^3.8.1",
    "webpack-chrome-extension-reloader": "^0.6.6"
  },
  "dependencies": {
    "chromedriver": "^2.37.0",
    "express": "^4.16.2",
    "express-ws": "^3.0.0",
    "geckodriver": "^1.11.0",
    "isomorphic-fetch": "^2.2.1",
    "portfinder": "^1.0.13",
    "selenium-webdriver": "^4.0.0-alpha.1",
    "simple-websocket": "^5.1.0",
    "ws": "^3.3.2"
  }
}

更改后编辑:

$ yarn build
yarn run v1.17.3
$ Set NODE_ENV=production&&webpack --config webpack
clean-webpack-plugin: ....\js\remote-browser\dist\extension has been removed.
Hash: 9cc6d50b90cbe6cd42f3869f2cfe024e1c4b19ca
Version: webpack 3.8.1
Child
    Hash: 9cc6d50b90cbe6cd42f3
Time: 10574ms
             Asset       Size  Chunks             Chunk Names
     background.js     233 kB       0  [emitted]  background
        content.js    36.3 kB       1  [emitted]  content
          popup.js    30.9 kB       2  [emitted]  popup
 background.js.map     292 kB       0  [emitted]  background
    content.js.map    45.7 kB       1  [emitted]  content
      popup.js.map    39.2 kB       2  [emitted]  popup
     manifest.json    1.24 kB          [emitted]
        popup.html    1.22 kB          [emitted]
         popup.css  466 bytes          [emitted]
img/icon-32x32.png  939 bytes          [emitted]
   [1] ./src/errors.js 3.02 kB {0} {1} [built]
   [3] (webpack)/buildin/global.js 488 bytes {0} [built]
   [7] ./src/common.js 2.37 kB {0} {1} [built]
  [19] ./src/extension/background.js 8.07 kB {0} [built]
  [20] ./src/connections/client.js 1.59 kB {0} [built]
  [36] ./src/connections/base.js 3.76 kB {0} [built]
  [37] ./src/extension/content.js 972 bytes {1} [built]
  [38] ./src/extension/popup.js 1.14 kB {2} [built]
    + 31 hidden modules
Child
Hash: 869f2cfe024e1c4b19ca
Time: 11522ms
       Asset     Size  Chunks                    Chunk Names
    index.js  1.42 MB       0  [emitted]  [big]  index
index.js.map  1.75 MB       0  [emitted]         index
  [29] ./src/errors.js 3.02 kB {0} [built]
  [35] ./src/common.js 2.37 kB {0} [built]
  [53] ./src/launchers.js 2.16 kB {0} [built]
 [108] ./src/connections/base.js 3.76 kB {0} [built]
 [109] ./src/connections/proxy.js 4.2 kB {0} [built]
 [112] ./src/index.js 1.08 kB {0} [built]
 [174] ./src/browser.js 8.21 kB {0} [built]
 [199] ./node_modules/encoding/lib 160 bytes {0} [optional] [built]
 [203] ./src/connections/index.js 612 bytes {0} [built]
 [204] ./src/connections/client.js 1.59 kB {0} [built]
 [219] ./src/connections/server.js 1.46 kB {0} [built]
    + 210 hidden modules

WARNING in ./node_modules/encoding/lib/iconv-loader.js
9:12-34 Critical dependency: the request of a dependency is an expression
 @ ./node_modules/encoding/lib/iconv-loader.js
 @ ./node_modules/encoding/lib/encoding.js
 @ ./node_modules/node-fetch/lib/body.js
 @ ./node_modules/node-fetch/index.js
 @ ./node_modules/isomorphic-fetch/fetch-npm-node.js
 @ ./src/browser.js
 @ ./src/index.js
 Done in 21.93s.

出现了一个 dist 文件夹

最佳答案

您可以尝试以下操作:

“build”:“设置 NODE_ENV=生产&&webpack --config webpack”

有时多余的空间可以被解释为属于 env 值。

关于javascript - Yarn 不会构建项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57580215/

相关文章:

java - Windows 区分大小写导致麻烦,无法将 Java 项目包含到 Eclipse

windows - 我需要 Hook 什么进程 API 来跟踪服务?

javascript - 在 JavaScript 中将数字月份替换为单词

javascript - 将之前选择的图像加载到输入文件中

javascript - 如何将 state 中定义的数组中的值传递给显示组件的组件?

node.js - 如何从 npm 发布的模块中导入流注解、类型和接口(interface)

node.js - 如何在 postman 中发送未定义的值?

javascript - 如何使用 javascript 将我的域名字母大写?

node.js - 退出模块,但不退出整个 NodeJS 进程

c++ - C++并发调用时如何保证CreateProcess只创建一个进程?