怎么成功npm install pretty-autoindex?
本帖最后由 mygis 于 2023-5-29 12:07 编辑我找到一个美化nginx目录文件的开源:
https://github.com/spring-raining/pretty-autoindex
然而,在vscode打开源码,npm install时,却发现总是无法成功,网上找了些办法,修改后也还是各种错误无法恢复开发环境。我在win10/centos7上都试过,还是各种错误。
哪位高手能测试下,然后告诉我什么系统、执行什么步骤,可以吗?谢谢!!!
pretty-autoindex的package.json:
{
"name": "pretty-autoindex",
"version": "1.1.0",
"description": "Show nginx autoindex more pretty!",
"keywords": [
"autoindex",
"nginx"
],
"scripts": {
"build": "./node_modules/gulp/bin/gulp.js build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/spring-raining/pretty-autoindex.git"
},
"author": "spring-raining",
"license": "MIT",
"bugs": {
"url": "https://github.com/spring-raining/pretty-autoindex/issues"
},
"homepage": "https://github.com/spring-raining/pretty-autoindex#readme",
"devDependencies": {
"babel": "^6.3.26",
"babel-core": "^6.4.5",
"babel-preset-es2015": "^6.3.13",
"babelify": "^7.2.0",
"del": "^2.2.0",
"gulp": "^3.9.0",
"gulp-browserify": "^0.5.1",
"gulp-sass": "^2.1.1",
"gulp-uglify": "^1.5.1",
"moment": "^2.11.1",
"primer-css": "^3.0.0",
"run-sequence": "^1.1.5",
"vue": "^1.0.15",
"vue-router": "^0.7.9",
"vueify": "^8.3.2"
},
"babel": {
"presets": [
"es2015"
]
}
}
本帖最后由 zhuxiangyu1024 于 2023-5-29 07:42 编辑
一个是使用python2,另一个有可能和node版本有关。 报错信息是什么? 也可能是因为网络不稳定,下载不成功 要不你试试:pnpm install pretty-autoindex 谢谢大家的热心回复{:1_893:}
问题解决了,原来是跟node版本有关。之前我试了最新版的node和早期的Node.js 0.12.18,结果都失败了。
今天安装的是:Node.js 7.10.1 ,系统centos7,git clone后,就是npm install和npm run build,build有个错误提示,但还是编译出来了:
npm run build
> pretty-autoindex@1.1.0 build /root/pretty/pretty-autoindex
> ./node_modules/gulp/bin/gulp.js build
Failed to load external module @babel/register
Requiring external module babel-register
Using gulpfile ~/pretty/pretty-autoindex/gulpfile.babel.js
Starting 'build'...
Starting 'clean'...
Finished 'clean' after 5.29 ms
Starting 'js'...
Starting 'css'...
Starting 'html'...
再次感谢!我想给诸位都评分的,可是只有1个就用完了,抱歉。 我在win10下用Node.js 7.10.1就成功不了:
(node:5040) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
[ ............] / fetchMetadata: sill mapToRegistry uri https://registry.npm.taobao.org/os-homedir
就卡住了,即使切换到清华源也不行。
虽然npm安装、build确实有它的长处,但恢复、各种错误是不是也很折磨人?有没有同感的?还是我技术太low了。。 在win10、win7,各种node版本折腾一晚上,各种错误无法成功,看来只能用linux的,真是太搞了。。。
页:
[1]