简体   繁体   English

使用 git clone 安装 NPM 导致错误

[英]NPM install with git clone resulting in error

I'm trying to build from source from a git clone rather than doing npm install package-name .我正在尝试从 git clone 的源代码构建,而不是执行npm install package-name This is the syntax I'm using: git clone package-name && cd package-name && npm i But I get some error shown below.这是我正在使用的语法: git clone package-name && cd package-name && npm i但我得到一些错误,如下所示。

$ git clone https://github.com/tradingview/lightweight-charts.git && cd lightweight-charts && npm i
Cloning into 'lightweight-charts'...
remote: Enumerating objects: 21225, done.
remote: Counting objects: 100% (230/230), done.
remote: Compressing objects: 100% (167/167), done.
remote: Total 21225 (delta 166), reused 102 (delta 60), pack-reused 20995
Receiving objects: 100% (21225/21225), 13.90 MiB | 448.00 KiB/s, done.
Resolving deltas: 100% (16144/16144), done.
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: eslint-plugin-jsdoc@37.9.7
npm ERR! notsup Not compatible with your version of node/npm: eslint-plugin-jsdoc@37.9.7
npm ERR! notsup Required: {"node":"^12 || ^14 || ^16 || ^17"}
npm ERR! notsup Actual:   {"npm":"8.5.5","node":"v18.3.0"}

npm ERR! A complete log of this run can be found in:

$ node --version v18.3.0 I should have the node version required ^17 $ node --version v18.3.0我应该有所需的节点版本^17

running npm install lightweight-charts works no problem but I don't get the latest git commits.运行npm install lightweight-charts没有问题,但我没有得到最新的 git 提交。

I forced the downgrade to $ sudo npm install -g node@17.0.0 --force我强制降级为$ sudo npm install -g node@17.0.0 --force

$ node -v
v17.0.0
$ cd lightweight-charts/
$ npm run build

> lightweight-charts@4.0.0 build
> npm-run-all tsc rollup bundle-dts

sh: line 1: npm-run-all: command not found
$ npm install npm-run-all
npm WARN deprecated tslint@6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.

added 657 packages, and audited 658 packages in 1m

148 packages are looking for funding
  run `npm fund` for details

5 high severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

$ npm run build

> lightweight-charts@4.0.0 build
> npm-run-all tsc rollup bundle-dts


> lightweight-charts@4.0.0 tsc
> ttsc -p tsconfig.prod.json


> lightweight-charts@4.0.0 rollup
> rollup -c rollup.config.js

Building version: 4.0.0-dev+202206211052

./lib/prod/src/index.js → ./dist/lightweight-charts.esm.development.js...
created ./dist/lightweight-charts.esm.development.js in 608ms

./lib/prod/src/standalone.js → ./dist/lightweight-charts.standalone.development.js...
created ./dist/lightweight-charts.standalone.development.js in 474ms

> lightweight-charts@4.0.0 bundle-dts
> tsc --noEmit --allowJs dts-config.js && dts-bundle-generator --config dts-config.js

Compiling input files...
Processing lib/prod/src/index.d.ts
Writing lib/prod/src/index.d.ts -> dist/typings.d.ts
Checking generated files...
Done in 1.65s

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM