博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vue+sass 下sass不能运行问题
阅读量:5242 次
发布时间:2019-06-14

本文共 2235 字,大约阅读时间需要 7 分钟。

好久没写博文了,今天抽空写一写,最近在用vue.js build 项目,今早想使用sass来编译css,可是安装好依赖包之后仍然显示一下错误:

ERROR in ENOENT: no such file or directory, scandir '/Users/baidu/Documents/mydata/hfutoj/node_modules/.npminstall/node-sass/3.8.0/node-sass/vendor' @ ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-rewriter.js!./~/.npminstall/sass-loader/4.0.0/sass-loader!./~/vue-loader/lib/selector.js?type=style&index=0!./src/components/footer.vue 4:14-273 13:2-17:4 14:20-279

  我vue component 里面是这样用的:

 我心想不应该啊,我依赖包都安装了,需要的依赖包是:node-sass ,sass-loader,vue-style-loader,css-loader,分析了下,觉得是node-sass没安装好,所以我就卸载了node-sass,然后又重新安装(注意cnpm是需要使用npm安装的,这个好像是淘宝的镜像,比较快):

npm remove node-sasscnpm install node-sass

  package.json里是这样写的:

{  "name": "hfutoj",  "version": "1.0.0",  "description": "oj for hfut",  "author": "hfuter",  "private": true,  "scripts": {    "dev": "node build/dev-server.js",    "build": "node build/build.js",    "test": ""  },  "dependencies": {    "vue": "^1.0.21",    "babel-runtime": "^6.0.0",    "semantic-ui": "*"  },  "devDependencies": {    "babel-core": "^6.0.0",    "babel-loader": "^6.0.0",    "babel-plugin-transform-runtime": "^6.0.0",    "babel-preset-es2015": "^6.0.0",    "babel-preset-stage-2": "^6.0.0",    "babel-register": "^6.0.0",    "connect-history-api-fallback": "^1.1.0",    "css-loader": "^0.23.0",    "eventsource-polyfill": "^0.9.6",    "express": "^4.13.3",    "extract-text-webpack-plugin": "^1.0.1",    "file-loader": "^0.8.4",    "function-bind": "^1.0.2",    "html-webpack-plugin": "^2.8.1",    "http-proxy-middleware": "^0.12.0",    "json-loader": "^0.5.4",    "less": "^2.7.1",    "less-loader": "^2.2.3",    "node-sass": "^3.7.0",    "ora": "^0.2.0",    "sass-loader": "^4.0.0",    "shelljs": "^0.6.0",    "url-loader": "^0.5.7",    "vue-hot-reload-api": "^1.2.0",    "vue-html-loader": "^1.0.0",    "vue-loader": "^8.3.0",    "vue-style-loader": "^1.0.0",    "webpack": "^1.12.2",    "webpack-dev-middleware": "^1.4.0",    "webpack-hot-middleware": "^2.6.0",    "webpack-merge": "^0.8.3"  }}

  但是,仍然报错,为毛?我发现重装之后错误并没有变,仍然是.npminstall 下面的文件没被找到,所以.npminstall(这是个隐藏文件)下的文件并没有被卸载,所以我决定把整个node_modules删除了再重装(cnpm install),之后就好了,不过我把ndoe-sass的版本号由3.8.0换成了3.7.0

 

转载于:https://www.cnblogs.com/hongrunhui/p/5814504.html

你可能感兴趣的文章
django ORM创建数据库方法
查看>>
php7 新特性整理
查看>>
RabbitMQ、Redis、Memcache、SQLAlchemy
查看>>
知识不是来炫耀的,而是来分享的-----现在的人们却…似乎开始变味了…
查看>>
03 线程池
查看>>
手机验证码执行流程
查看>>
设计模式课程 设计模式精讲 2-2 UML类图讲解
查看>>
Silverlight 的菜单控件。(不是 Toolkit的)
查看>>
jquery的contains方法
查看>>
linux后台运行和关闭SSH运行,查看后台任务
查看>>
桥接模式-Bridge(Java实现)
查看>>
303. Range Sum Query - Immutable
查看>>
【★】浅谈计算机与随机数
查看>>
Leetcode 226: Invert Binary Tree
查看>>
C# Dynamic通用反序列化Json类型并遍历属性比较
查看>>
前台freemark获取后台的值
查看>>
Leetcode: Unique Binary Search Trees II
查看>>
C++ FFLIB 之FFDB: 使用 Mysql&Sqlite 实现CRUD
查看>>
Spring-hibernate整合
查看>>
c++ map
查看>>