Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

npm run build在特定环境下失败 #23

Open
chenyulun opened this issue Apr 26, 2021 · 0 comments
Open

npm run build在特定环境下失败 #23

chenyulun opened this issue Apr 26, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@chenyulun
Copy link

npx版本7.3.0 npm版本7.3.0 node版本15.5.0
报错信息如下

 ~/github/hummer-cli   main ●  npm run build

> @hummer/cli-plugins@1.0.0 build
> lerna run build

lerna notice cli v3.22.1
lerna info Executing command in 7 packages: "npm run build"
lerna ERR! npm run build exited 236 in '@hummer/cli-utils'
lerna ERR! npm run build stdout:

> @hummer/cli-utils@0.1.16 build
> npx ../../node_modules/.bin/tsc


lerna ERR! npm run build stderr:
npm ERR! code ENOTDIR
npm ERR! syscall open
npm ERR! path /Users/chenyulun390/github/hummer-cli/node_modules/.bin/tsc/package.json
npm ERR! errno -20
npm ERR! ENOTDIR: not a directory, open '/Users/chenyulun390/github/hummer-cli/node_modules/.bin/tsc/package.json'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/chenyulun390/.npm/_logs/2021-04-26T10_17_34_940Z-debug.log
npm ERR! code 236
npm ERR! path /Users/chenyulun390/github/hummer-cli/packages/cli-utils
npm ERR! command failed
npm ERR! command sh -c npx ../../node_modules/.bin/tsc

报错分析:
当前版本npx的第二个参数需要是一个带有package.json的包,或者可执行文件的名称
我把

{
"build": "npx ../../node_modules/.bin/tsc"
}

替换成下面这段段就行了

{
"build": "npx tsc"
}

简单的方法是搜索../../node_modules/.bin/全部替换为空

希望修改一下构建问题,谢谢

@duanlikang duanlikang self-assigned this Apr 26, 2021
@duanlikang duanlikang added the enhancement New feature or request label Apr 26, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants