You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行npm install时出现E404错误,请求技术指导

解决npm install时的E404错误(找不到tsnode包)

Hey there, I’ve dealt with this exact error before—let’s get it sorted out quickly!

问题根源

The error npm ERR! 404 Not Found - GET https://registry.npmjs.org/tsnode - Not found is almost certainly due to a typo in the package name. There’s no package called tsnode on the npm registry—you’re looking for ts-node (with a hyphen), the popular TypeScript execution environment for Node.js.

修复步骤

  • 检查并修正package.json:打开你的package.json文件,找到dependencies或devDependencies里的tsnode条目,把它改成ts-node。
  • 重新执行正确的安装命令:
    • 本地安装(项目依赖):
      npm install ts-node
      
    • 全局安装(系统级可用):
      npm install -g ts-node
      
  • 可选:安装类型依赖:如果你的项目用TypeScript,建议同时安装@types/node来获得Node.js的类型定义,避免编译报错:
    npm install @types/node --save-dev
    

额外排查(如果上述步骤无效)

If you’ve fixed the typo and still get the error, double-check your npm registry configuration to make sure it’s pointing to the official npm registry:

npm config get registry

If it returns something other than https://registry.npmjs.org/, you can reset it with:

npm config set registry https://registry.npmjs.org/

内容的提问来源于stack exchange,提问作者Anum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 23:59:06