sass报错以及npm start报端口8080被占用错误的解决方法

sass安装
1、首次安装,首先在命令提示符全局安装:

npm install sass -g
2,在vue终端敲下面代码(电脑上之前全局安装过Sass,不需要第一步操作,直接在项目上安装依赖)

npm install –save-dev sass-loader

1、首先查找到占用8080端口的进程号PID是多少
CMD>netstat -ano | findstr 8080
这个命令输出的最后一列表示占用8080端口的进程号是多少,假设为1234

2、kill掉这个进程
CMD>taskkill /F /PID 1234

这样8080端口就是释放了。

1. 在启动命令中直接指定 (自测无用,好坏自辩哈哈)

npm start — -p xxxx //此处注意 start 和 -p 之间的 — !!

Error: listen EACCES 0.0.0.0:8080 错误解决记录

live-server — 热加载利器
实现本地服务器,可及时刷新。

1.通过npm install -g live-server进行安装

2.npm init 初始化项目
3.在所需要的文件夹内运行live-server命令

4.默认是进入文件夹下面的index.html文件 如果文件夹中不包含index.html 则会列出该文件夹下的目录进行选择

输入命令 live-sever 启动,默认会自动打开浏览器,并且访问8080端口,若出现Error: listen EACCES 0.0.0.0:8080 问题,说明是端口被占用了。

其中一种解决办法为:更换本地的端口,执行下述指令,即可

live-server –port=8083

https://www.npmjs.com/products

package.json:

{
  "private": true,
  "scripts": {
    "start": "npm run sass:build && npm-run-all --parallel sass:watch serve",
    "sass:build": "sass --load-path node_modules src:src",
    "sass:watch": "npm run sass:build -- --watch",
    "serve": "live-server --port=8081 src --mount=/node_modules:node_modules",
    "postinstall": "node ../../delete-package-lock.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@ag-grid-community/styles": "latest",
    "@fortawesome/fontawesome-free": "^6.1.1",
    "ag-grid-community": "latest",
    "ag-grid-enterprise": "latest",
    "live-server": "^1.2.2",
    "npm-run-all": "^4.1.5",
    "sass": "^1.51.0"
  },
  "devDependencies": {
    "node-sass": "^9.0.0"
  }
}

参考:
https://www.cnblogs.com/wfaceboss/p/10011019.html
https://blog.csdn.net/qq_59807756/article/details/130305128
https://blog.csdn.net/Ccc67ol/article/details/130240490
https://blog.csdn.net/qq_39737056/article/details/101678187
https://blog.csdn.net/Connie_wuxx/article/details/134478770

原文链接:https://www.hertzdance.com/blog/sass-npm-8080,转载请注明出处。

0

评论0

请先
欢迎光临频率跳动资源网
显示验证码
没有账号?注册  忘记密码?