我正在查看https://github.com/intoli/remote-browser。我正在使用节点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": "[email protected]:intoli/remote-browser.git",
  "author": "Intoli, LLC <[email protected]>",
  "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"
  }
}


进行更改后的editL:

$ 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": "Set NODE_ENV=production&&webpack --config webpack"

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

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

10-16 05:58