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 ...
随机推荐
- MySQL学习笔记(四)悲观锁与乐观锁
恼骚 最近在搞并发的问题,订单的异步通知和主动查询会存在并发的问题,用到了Mysql数据库的 for update 锁 在TP5直接通过lock(true),用于数据库的锁机制 Db::name('p ...
- java(8)二重循环
一.二重循环 1.循环中,嵌套另外一个循环,将内层的循环,看成外层循环的一个循环操作 2.常见的二重循环 形式1: 外层while或do…while 内层为for循环 形式2: 外层.内层都 ...
- Concurrent下的线程安全集合
1.ArrayBlockingQueue ArrayBlockingQueue是由数组支持的线程安全的有界阻塞队列,此队列按 FIFO(先进先出)原则对元素进行排序.这是一个典型的“有界缓存区”,固定 ...
- gulp学习笔记——最好的学习文档是官网
官网:http://www.gulpjs.com.cn/docs/api/ 当然还有一个博客写的也很好,当我看不下去官网的时候,这个帮助了我很多,明了易懂:http://www.ydcss.com/a ...
- win10自带邮箱添加网易企业邮箱
开始-邮件-账户-添加账户-高级安装程序-internet电子邮件-然后输入网易企业邮箱的用户名和相关服务器设置就行了 接收服务器 pop.qiye.163.com发送服务器 smtp.qiye.16 ...
- Codeforces 1097G
根本想不到 CF1097G 题意 给出一棵树,定义f(S)为用最少的边连通点集$ S$的边数 求$ \sum\limits f(S)^k$ $ n \leq 10^5 k \leq 200$ 题解 假 ...
- MYSQL实战
基础架构 更新操作 日志模块 redo log 和 binlog 两阶段提交: prepare commit 事务隔离 读未提交:别人改数据的事务尚未提交,我在我的事务中也能读到.读已提交:别人改数据 ...
- Stm32 GPIO复习
地点:中图四楼. 1.七个寄存器 配置寄存器:GPIOx_CPL.GPIOx_CPH; 数据寄存器:GPIOx_IDR.GPIOx_ODR: 置位/复位寄存器:GPIOx_BSRR 复位寄存器:GPI ...
- javascript基础 之 表单
1,js可以验证表单 实例1,js获取表单的内容 //html表单是这样的 <form name="myForm" action="demo_form.php&qu ...
- 微信小程序 Button控件 点击传值给JavaScript
直接看例子吧: WXML:直接看Button,用“data-”(data-total)传值,后台如何获取,继续看下面JS代码. <view class="infothird" ...