07 开发板部署nodejs
在开发板上运行node.js
添加环境变量
nodejs主要有2个可执行文件:node
, npm
他们都在同一个目录下,为了后面简单使用,需要把该目录添加到环境变量并开机自动设置
换源
1 | npm config set registry https://registry.npmmirror.com |
关闭ssl验证
1 | npm config set strict-ssl false |
安装依赖
由于js是个跨平台语言,所以只要给开发板移植了nodejs环境,就可以使用其丰富的前端代码了
安装依赖时有2种选项:
- 全局安装:npm install xxx -g
- 局部安装:npm install xxx,会在当前目录生成一个
node_modules
文件夹,新安装的依赖都在该目录下,切换到别的目录运行js就不行了
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.