node.lib报库已损坏问题

Vue项目搭建流程
本文介绍如何从Git上拉取并运行一个Vue项目,包括使用npm和yarn进行依赖包安装及构建过程。针对node.lib库损坏问题提供了解决方案,并说明了前后端端口配置的一致性要求。

从git上拉取一个vue项目,跑起来的的步骤为:

npm install node-sass

npm install

npm install -g vue-cli

cd "前端项目"

npm run dev

如果报错 node.lib库已损坏问题,可能是node.js 的问题,把目前的63位node.js换成32位的,卸载掉之前的,重新安装32位即可。

node.js 下载地址为 https://nodejs.org/en/download/

如果需要,还要 composer install 后端项目

第二种方式

直接进入前端项目的目录

yarn

yarn build

yarn run dev

 

git check xxxx

出现:error: The following untracked working tree files would be overwritten by checkout

 git clean -d -fx 

vue 启动端口修改:

  config/index.js  prot

如果登陆成功后,跳转页面报401,很可能是端口配置错误,你的后端项目端口和前端这里配置的端口要一致比如都是8100端口

 

 

C:\Users\30614>npm config set cache "C:\temp\npm-cache" --global npm error code EPERM npm error syscall mkdir npm error path D:\node.js\node_global\etc npm error errno -4048 npm error Error: EPERM: operation not permitted, mkdir 'D:\node.js\node_global\etc' npm error at async mkdir (node:internal/fs/promises:852:10) npm error at async Config.save (D:\node.js\node_modules\npm\node_modules\@npmcli\config\lib\index.js:746:5) npm error at async Config.set (D:\node.js\node_modules\npm\lib\commands\config.js:206:5) npm error at async Config.exec (D:\node.js\node_modules\npm\lib\commands\config.js:151:9) npm error at async Npm.exec (D:\node.js\node_modules\npm\lib\npm.js:207:9) npm error at async module.exports (D:\node.js\node_modules\npm\lib\cli\entry.js:74:5) { npm error errno: -4048, npm error code: 'EPERM', npm error syscall: 'mkdir', npm error path: 'D:\\node.js\\node_global\\etc' npm error } npm error npm error The operation was rejected by your operating system. npm error It's possible that the file was already in use (by a text editor or antivirus), npm error or that you lack permissions to access it. npm error npm error If you believe this might be a permissions issue, please double-check the npm error permissions of the file and its containing directories, or try running npm error the command again as root/Administrator. npm error Log files were not written due to an error writing to the directory: D:\node.js\node_cache\_logs npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
05-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值