上杉江树 2021-06-10 19:55 采纳率: 0%
浏览 507

配置离线remix环境出错npm ERR! Missing script: "prepublish"

根据以下步骤在ubuntu下配置离线remix环境:

git clone https://github.com/ethereum/browser-solidity
cd browser-solidity
npm install
npm run prepublish

当执行到最后npm run prepublish时,提示错误:

npm ERR! Missing script: "prepublish"
npm ERR! 
npm ERR! Did you mean one of these?
npm ERR!     npm publish # Publish a package
npm ERR!     npm unpublish # Remove a package from the registry
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bluesky/.npm/_logs/2021-06-10T11_04_20_915Z-debug.log

 根据提示查看日志文件2021-06-10T11_04_20_915Z-debug.log:

0 verbose cli [
0 verbose cli   '/usr/local/node/node-v15.8.0-linux-x64/bin/node',
0 verbose cli   '/usr/local/node/node-v15.8.0-linux-x64/bin/npm',
0 verbose cli   'run',
0 verbose cli   'prepublish'
0 verbose cli ]
1 info using npm@7.16.0
2 info using node@v15.8.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/node/node-v15.8.0-linux-x64/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 2ms
10 timing config:load:file:/home/bluesky/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/local/node/node-v15.8.0-linux-x64/etc/npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:validate Completed in 0ms
15 timing config:load:credentials Completed in 1ms
16 timing config:load:setEnvs Completed in 0ms
17 timing config:load Completed in 7ms
18 timing npm:load:configload Completed in 7ms
19 timing npm:load:setTitle Completed in 0ms
20 timing npm:load:setupLog Completed in 1ms
21 timing npm:load:cleanupLog Completed in 1ms
22 timing npm:load:configScope Completed in 0ms
23 timing npm:load:projectScope Completed in 0ms
24 timing npm:load Completed in 11ms
25 timing config:load:flatten Completed in 1ms
26 timing command:run-script Completed in 46ms
27 verbose stack Error: Missing script: "prepublish"
27 verbose stack
27 verbose stack Did you mean one of these?
27 verbose stack     npm publish # Publish a package
27 verbose stack     npm unpublish # Remove a package from the registry
27 verbose stack
27 verbose stack To see a list of scripts, run:
27 verbose stack   npm run
27 verbose stack     at RunScript.run (/usr/local/node/node-v15.8.0-linux-x64/lib/node_modules/npm/lib/run-script.js:105:13)
28 verbose cwd /home/bluesky/browser-solidity
29 verbose Linux 5.8.0-55-generic
30 verbose argv "/usr/local/node/node-v15.8.0-linux-x64/bin/node" "/usr/local/node/node-v15.8.0-linux-x64/bin/npm" "run" "prepublish"
31 verbose node v15.8.0
32 verbose npm  v7.16.0
33 error Missing script: "prepublish"
33 error
33 error Did you mean one of these?
33 error     npm publish # Publish a package
33 error     npm unpublish # Remove a package from the registry
33 error
33 error To see a list of scripts, run:
33 error   npm run
34 verbose exit 1

请问这种情况该怎么处理?

 

 

  • 写回答

1条回答 默认 最新

  • weixin_45914588 2023-04-03 09:57
    关注

    根据日志文件显示,运行命令npm run prepublish时,提示找不到"prepublish"这个脚本。这很可能是因为当前的版本的browser-solidity已经不再支持prepublish脚本了。

    你可以尝试将步骤改为:

    git clone https://github.com/ethereum/browser-solidity
    cd browser-solidity
    npm install
    npm run build
    这里使用了npm run build命令来替代原来的npm run prepublish,这个命令将会使用Webpack打包应用程序,构建生产环境所需的文件并输出到build目录下。

    如果还有其他问题,请参考项目文档或者尝试在GitHub上创建一个issue来获取更多帮助。

    评论

报告相同问题?

悬赏问题

  • ¥20 为什么zynq CAN IP 无法进入config配置模式,XCan_SelfTest函数失效?
  • ¥15 Pycharm中程序直接运行可以但进入调试报错
  • ¥15 MATLAB动图问题
  • ¥15 有段代码不知道怎么理解,const isToken = (config.headers || {}).isToken === false
  • ¥15 我的显卡支持CUDA最高版本是12.3,这个版本也支持VS 2022 17.0这种情况下如果我想下载CUDA11.8,需要下载旧版本的VS2022吗
  • ¥100 采用栈和深度优先算法取消graphics库采用其他方式显示路径打印显示路径取消graphics库
  • ¥15 pointnet2包安装
  • ¥20 射频功率问题,解答者有酬谢!
  • ¥80 构建降雨和积水的预测模型
  • ¥15 #Qt Transform setTransform()在鼠标拖动移动视角是一致在原地不动,无法变换视角(细微观察似乎视图有在原地抖动),无法变换视角(细微观察似乎视图有在原地抖动)