Solve Error: node postinstall sh: node: command not found
When install the yeoman using the following command:
npm install -g yo
You might have the following error:
npm WARN deprecated cross-spawn-async@2.2.: cross-spawn no longer requires a build toolchain, use it instead
/root/.nvm/versions/node/v9.3.0/bin/yo -> /root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/lib/cli.js
/root/.nvm/versions/node/v9.3.0/bin/yo-complete -> /root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/lib/completion/index.js > spawn-sync@1.0. postinstall /root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/node_modules/spawn-sync
> node postinstall sh: node: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! spawn-sync@1.0.15 postinstall: `node postinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.15 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-11-25T16_49_27_843Z-debug.log
Try the following commands instead:
npm install -g try-thread-sleep
npm install -g yo --ignore-scripts spawn-sync
Now try to type 'yo' to see if yeoman installed correctly, if you happened to have following error:
/root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/node_modules/write-file-atomic/index.js:
throw err
^ Error: EACCES: permission denied, open '/root/.config/insight-nodejs/insight-yo.json.3393582327'
at Object.fs.openSync (fs.js:663:18)
at Function.writeFileSync [as sync] (/root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/node_modules/write-file-atomic/index.js:180:17)
at Conf.set store [as store] (/root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/node_modules/conf/index.js:142:19)
at Conf.set (/root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/node_modules/conf/index.js:64:14)
at Insight.set optOut [as optOut] (/root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/node_modules/insight/lib/index.js:56:15)
at Object.<anonymous> (/root/.nvm/versions/node/v9.3.0/lib/node_modules/yo/lib/cli.js:198:18)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
Try the following command to fix:
chmod g+rwx /root/.config/insight-nodejs/
If everything works fine, after type 'yo', you should see the following output:
❯ yo
? ==========================================================================
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/yeoman/insight & http://yeoman.io
========================================================================== Yes
? 'Allo Grandyang! What would you like to do? Install a generator
? Search npm for generators: Express
? Here's what I found. Official generator → ෴
Install one? Return home
? 'Allo Grandyang! What would you like to do? Get me out of here! _-----_ ╭───────────────────────╮
| | │ Bye from us! │
|--(o)--| │ Chat soon. │
`---------´ │ Yeoman team │
( _´U`_ ) │ http://yeoman.io │
/___A___\ /╰───────────────────────╯
| ~ |
__'.___.'__
´ ` |° ´ Y `
Solve Error: node postinstall sh: node: command not found的更多相关文章
- node修改全局环境路径 与 全局后出现sh:exe command not found
修改全局环境路径 当安装nodeJs时候需要修改全局环境的指向,先看看npm config get prefix 全局环境在哪里 然后执行更换命令,一个是主文件一个是缓存文件 npm config ...
- mysql-xtrabackup备份sh: xtrabackup_56: command not found与error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory
sh: xtrabackup_56: command not foundinnobackupex: fatal error: no 'mysqld' group in MySQL options解决办 ...
- k8s1.11.0安装、一个master、一个node、查看node名称是主机名、node是扩容进来的、带cadvisor监控服务
一个master.一个node.查看node节点是主机名 # 安装顺序:先在test1 上安装完必要组件后,就开始在 test2 上单独安装node组件,实现node功能,再返回来配置test1加入集 ...
- k8s1.11.0安装、一个master、一个node、查看node名称是ip、node是扩容进来的、带cadvisor监控服务
一个master.一个node.查看node节点是ip # 安装顺序:先在test1 上安装完必要组件后,就开始在 test2 上单独安装node组件,实现node功能,再返回来配置test1加入集群 ...
- xtrabackup-解压备份文件报错sh: qpress: command not found
# xtrabackup --decompress --target-dir=/data/compressed xtrabackup version 2.4.8 based on MySQL serv ...
- docker export import后,导入镜像,启动时的错误,Error response from daemon: No command specified
Docker的流行与它对容器的易分享和易移植密不可分,用户不仅可以把容器提交到公共服务器上,还可以把容器导出到本地文件系统中.同样,我们也可以把导出的容器重新导入到Docker运行环境中.Docker ...
- mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES
AutoMySQLBackup备份时,出现mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@' ...
- 一起来学node.js吧 node school简介
node.js这几年火爆的简直丧心病狂,去lagou.com查查node.js的职位,那叫一个多. 要说火爆到什么程度,竟然有一个网站专门去教大家学习node.js, Node School. 进去逛 ...
- rosetta common sh: mpiCC command not found解决方法
在执行多线程编译rosetta时执行: python scons.py bin mode=release extras=mpi -j8 编译安装rosetta 会出现错误sh: mpiCC comma ...
随机推荐
- ASP.NET WebApi 自带Json返回日期带T无法格式化的问题
WebApi自带json序列化对遇到时间日期字段的时候,到前端获取的格式总是为“ 2016-07-14T15:32:44”,中间总是会带一个T,显然不是很友好.先是偷懒在园子里边去找一些解决方案,尝试 ...
- 第十三节:实际开发中使用最多的监视锁Monitor、lock语法糖的扩展、混合锁的使用(ManualResetEvent、SemaphoreSlim、ReaderWriterLockSlim)
一. 监视锁(Monitor和lock) 1. Monitor类,限定线程个数的一把锁,两个核心方法: Enter:锁住某个资源. Exit:退出某一个资源. 测试案例:开启5个线程同时对一个变量进行 ...
- [再寄小读者之数学篇](2014-07-27 $H^{-1}$ 中的有界集与弱收敛极限)
设 $H^{-1}$ 是 $H^1_0$ 的对偶空间, 定义域为 $[0,1]$. 试证: (1) $\sed{h\sin (2\pi hx);\ h>0}$ 在 $H^{-1}$ 中有界; ( ...
- react-router(v4) 路由跳转后返回页面顶部问题
遇到的问题 由A页面跳转到B页面,B页面停留在A页面的位置,没有返回到顶部. 问题分析 首先分析下出现此问题的原因: 在项目中使用的是 hashHistory,它是建立在 history 之上的,当路 ...
- Codeforces 1100F(线性基+贪心)
题目链接 题意 给定序列,$q(1\leq q \leq 100000) $次询问,每次查询给定区间内的最大异或子集. 思路 涉及到最大异或子集肯定从线性基角度入手.将询问按右端点排序后离线处理询问, ...
- swoole简单demo测试
测试代码 1.server.php: <?php $serv = new swoole_server("0.0.0.0", 9502); $serv->on('conn ...
- 解决ajax跨域的办法,代理,cors,jsonp
1.使用php做代理去请求第三方api接口 php是可以跨域的,我们利用ajax请求本域名中的php文件,php再去请求第三方接口文件,从而达到跨域目的. php做代理请求: ajax请求本域名php ...
- 有趣的F-String
F-String 让人上瘾 一个工具脚本的例子 https://www.pydanny.com/python-f-string-are-fun.html 在Python3.6的发布中,我们看到他们采纳 ...
- VMware的NAT网络模式
参考链接:https://www.cnblogs.com/linjiaxin/p/6476480.html 图例:
- Python-Django-BBS
一个项目从无到有 1 需求分析 -登录ajax,图形验证码 -注册forms和ajax,上传头像,头像预览 -博客首页 -个人站点 -点赞,点踩 -评论 -根评论 -子评论 -后台展示 -添加文章 - ...