0

我正在尝试在 Windows 10 机器上为 decentraland 设置一个本地项目,并且在安装全局 decentraland 依赖项时遇到了一些问题。我发现了一个相关的 stackoverflow 问题(npm install errors with Error: ENOENT, chmod),但它并没有解决我的问题。

我节点版本 17.5.0

我的 npm 版本是 8.5.1

当我尝试运行 npm install -g decentraland 时,我得到以下输出: 在此处输入图像描述

由于不存在 C:/php 目录不存在的系统调用和 php 系统调用与 decentraland 节点的依赖项安装无关,我收到很多警告和 ENOENT 错误。

这是我的 package.json:

  "name": "decentraland",
  "version": "3.9.0",
  "description": "Decentraland CLI developer tool.",
  "bin": {
    "dcl": "dist/index.js"
  },
  "files": [
    "bin",
    "dist",
    "samples",
    "abi"
  ],
  "scripts": {
    "start": "npm run watch",
    "watch": "tsc -p tsconfig.json -w",
    "build": "tsc -p tsconfig.json",
    "lint": "eslint . --ext .ts",
    "lint:fix": "eslint --fix . --ext .ts",
    "test": "FORCE_COLOR=1 ava",
    "test:dry": "FORCE_COLOR=1 ava --update-snapshots",
    "test:ci": "FORCE_COLOR=1 ava -v --fail-fast --match='!*E2E*' --match='!*Decentraland.deploy()*'",
    "test:win": "set FORCE_COLOR=1 ava -v --fail-fast --match=\"!*E2E*\" --match=\"!*Decentraland.deploy()*\""
  },
  "repository": "decentraland/cli",
  "keywords": [
    "decentraland",
    "cli",
    "dcl",
    "mana",
    "land"
  ],
  "ava": {
    "compileEnhancements": false,
    "extensions": [
      "ts"
    ],
    "require": [
      "ts-node/register"
    ]
  },
  "license": "Apache-2.0",
  "homepage": "https://github.com/decentraland/cli",
  "devDependencies": {
    "@dcl/eslint-config": "^1.0.1-20211125144552.commit-722b3e8",
    "@types/analytics-node": "0.0.32",
    "@types/archiver": "^3.0.0",
    "@types/chalk": "^2.2.0",
    "@types/cors": "^2.8.12",
    "@types/cross-spawn": "^6.0.2",
    "@types/express": "^4.11.1",
    "@types/fs-extra": "^5.0.0",
    "@types/glob": "^7.1.1",
    "@types/inquirer": "0.0.36",
    "@types/isomorphic-fetch": "0.0.34",
    "@types/node": "^12.12.55",
    "@types/puppeteer": "^1.11.2",
    "@types/request": "^2.48.1",
    "@types/rimraf": "^3.0.2",
    "@types/semver": "^7.3.9",
    "@types/sinon": "^5.0.5",
    "@types/uuid": "^8.3.3",
    "@types/ws": "^6.0.1",
    "ava": "^1.2.1",
    "cross-spawn": "^6.0.5",
    "husky": "^7.0.4",
    "puppeteer": "^1.17.0",
    "rimraf": "^2.6.2",
    "sinon": "^7.1.1",
    "ts-node": "^4.1.0"
  },
  "dependencies": {
    "@dcl/linker-dapp": "^0.1.3",
    "@dcl/schemas": "^3.4.1",
    "analytics-node": "^3.2.0",
    "archiver": "^3.1.1",
    "arg": "^4.1.0",
    "chalk": "^2.3.1",
    "chokidar": "^2.0.3",
    "cors": "^2.8.4",
    "dcl-catalyst-client": "^11.0.0",
    "dcl-catalyst-commons": "^8.0.0",
    "dcl-node-runtime": "^1.0.0",
    "docker-names": "^1.0.3",
    "eth-connect": "^0.3.0",
    "ethers": "^4.0.38",
    "express": "^4.16.2",
    "fs-extra": "^7.0.1",
    "glob": "^7.1.3",
    "global": "^4.4.0",
    "google-protobuf": "^3.8.0",
    "ignore": "^4.0.6",
    "inquirer": "^6.2.0",
    "isomorphic-fetch": "^2.2.1",
    "opn": "^5.2.0",
    "ora": "^3.0.0",
    "package-json": "^7.0.0",
    "portfinder": "^1.0.13",
    "request": "^2.88.0",
    "semver": "^5.5.0",
    "typescript": "^4.4.3",
    "uuid": "^3.4.0",
    "wildcards": "^1.0.2",
    "ws": "^6.0.0"
  },
  "commit": "d10dbf453d860dbc5062db3114cae791eb09e21a"

 

我试过的: -npm cache clean && npm cache verify

  • 我尝试了“rm package-lock.json”,但我的全局节点目录上没有 package-lock.json
  • 重新安装 npm
  • 更新 node.js
  • 我尝试更新一些 node.js 说不推荐使用的包。
  • npm 安装 -g npm-check-updates + npm 更新 + npm 安装

在这里你可以看到/npm/node_modules/decentraland/node_modules/eccrypto/package.json:

"name": "eccrypto", 
"version": "1.1.6",
"description": "JavaScript Elliptic curve cryptography library",
"main": "index.js",
"browser": "browser.js",
"scripts": {
  "install": "node-gyp rebuild || exit 0",
  "test": "ECCRYPTO_NO_FALLBACK=1 mocha && xvfb-run -a karma start && jshint .",
  "m": "mocha",
  "k": "xvfb-run -a karma start",
  "kc": "xvfb-run -a karma start --browsers Chromium",
  "kf": "xvfb-run -a karma start --browsers Firefox",
  "j": "jshint ."
},
"repository": {
  "type": "git",
  "url": "https://github.com/bitchan/eccrypto.git"
},
"keywords": [
  "ecc",
  "ecdsa",
  "ecdh",
  "ecies",
  "crypto",
  "cryptography",
  "secp256k1",
  "K-256",
  "elliptic",
  "curve"
],
"author": "Kagami Hiiragi",
"license": "CC0-1.0",
"bugs": {
  "url": "https://github.com/bitchan/eccrypto/issues"
},
"homepage": "https://github.com/bitchan/eccrypto",
"devDependencies": {
  "browserify": "16.5.0",
  "buffer-equal": "1.0.0",
  "chai": "*",
  "jshint": "*",
  "karma": "4.3.0",
  "karma-browserify": "6.1.0",
  "karma-chrome-launcher": "3.1.0",
  "karma-cli": "2.0.0",
  "karma-firefox-launcher": "1.2.0",
  "karma-mocha": "1.3.0",
  "karma-mocha-reporter": "2.2.5",
  "mocha": "*"
},
"dependencies": {
  "acorn": "7.1.1",
  "elliptic": "6.5.4",
  "es6-promise": "4.2.8",
  "nan": "2.14.0"
},
"optionalDependencies": {
  "secp256k1": "3.7.1"
}

最后,这里是 npm 所指的日志文件内容的最后一部分(C:\Users\alons\AppData\Local\npm-cache_logs\2022-02-20T11_30_21_888Z-debug-0.log):

node_modules/decentraland/node_modules/eccrypto/node_modules/secp256k1 npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."
3233 info run secp256k1@3.8.0 install node_modules/decentraland/node_modules/hdkey/node_modules/secp256k1 npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."
3234 info run eccrypto@1.1.6 install { code: 'ENOENT', signal: undefined }
3235 info run keccak@3.0.2 install { code: 'ENOENT', signal: undefined }
3236 info run secp256k1@4.0.2 install { code: 'ENOENT', signal: undefined }
3237 info run secp256k1@3.7.1 install { code: 'ENOENT', signal: undefined }
3238 info run secp256k1@3.8.0 install { code: 'ENOENT', signal: undefined }
3239 verbose reify failed optional dependency C:\Users\alons\AppData\Roaming\npm\node_modules\decentraland\node_modules\eccrypto\node_modules\secp256k1
3240 silly reify mark deleted [
3240 silly reify   'C:\\Users\\alons\\AppData\\Roaming\\npm\\node_modules\\decentraland\\node_modules\\eccrypto\\node_modules\\secp256k1'
3240 silly reify ]
3241 timing build:run:install:node_modules/decentraland/node_modules/eccrypto/node_modules/secp256k1 Completed in 9ms
3242 timing reify:rollback:createSparse Completed in 2333ms
3243 timing reify:rollback:retireShallow Completed in 4ms
3244 timing command:install Completed in 13078ms
3245 verbose stack Error: spawn C:\php ENOENT
3245 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
3245 verbose stack     at onErrorNT (node:internal/child_process:476:16)
3245 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
3246 verbose pkgid eccrypto@1.1.6
3247 verbose cwd C:\
3248 verbose Windows_NT 10.0.19044
3249 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\alons\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "decentraland"
3250 verbose node v17.5.0
3251 verbose npm  v8.5.1
3252 error code ENOENT
3253 error syscall spawn C:\php
3254 error path C:\Users\alons\AppData\Roaming\npm\node_modules\decentraland\node_modules\eccrypto
3255 error errno -4058
3256 error enoent spawn C:\php ENOENT
3257 error enoent This is related to npm not being able to find a file.
3257 error enoent
3258 verbose exit -4058
3259 timing npm Completed in 13401ms
3260 verbose unfinished npm timer reify 1645358538302
3261 verbose unfinished npm timer reify:build 1645358548960
3262 verbose unfinished npm timer build 1645358548962
3263 verbose unfinished npm timer build:deps 1645358548962
3264 verbose unfinished npm timer build:run:install 1645358549017
3265 verbose unfinished npm timer build:run:install:node_modules/decentraland/node_modules/eccrypto 1645358549018
3266 verbose unfinished npm timer build:run:install:node_modules/decentraland/node_modules/keccak 1645358549025
3267 verbose unfinished npm timer build:run:install:node_modules/decentraland/node_modules/secp256k1 1645358549028
3268 verbose unfinished npm timer build:run:install:node_modules/decentraland/node_modules/hdkey/node_modules/secp256k1 1645358549034
3269 verbose code -4058
3270 error A complete log of this run can be found in:
3270 error     C:\Users\alons\AppData\Local\npm-cache\_logs\2022-02-20T12_02_17_980Z-debug-0.log
4

0 回答 0