搭建TS环境,npm install -g -typescript命令报错
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/Dobo/Desktop/workspaces/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/Dobo/Desktop/workspaces/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
需要用管理员账号,修改下载的镜像源,改成淘宝的镜像源
1.使用管理员权限账号
2.npm config set registry https://registry.npm.taobao.org
修改后,可以正常mpn安装