报错信息
D:\nvm\nvm\v16.15.0\VERDACCIO.CMD:1
@ECHO off
^
SyntaxError: Invalid or unexpected token
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Object.<anonymous> (D:\nvm\nvm\v14.19.3\node_modules\pm2\lib\ProcessContainerFork.js:33:23)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
解决方法
找到verdaccio包文件地址
我的是D:\nvm\nvm\v16.15.0\node_modules\verdaccio\bin\verdaccio
运行pm2 start D:\nvm\nvm\v16.15.0\node_modules\verdaccio\bin\verdaccio

这篇博客主要介绍了在使用Verdaccio时遇到的启动错误,错误信息为`SyntaxError: Invalid or unexpected token`。作者提供了详细的错误原因分析及解决方案,包括定位到verdaccio包的路径并使用pm2命令正确启动服务。通过这个总结,读者可以学习到如何处理类似的Node.js语法错误和使用pm2管理进程的方法。
412

被折叠的 条评论
为什么被折叠?



