Skip to content

Webpack, vue-cli and sass: failed to map segment from shared object: Operation not permitted #526

Closed
@TisteDup

Description

@TisteDup

My environment:

  • Centos7 via VirtualBox (installed on Windows7) with a mounted folder
  • Node version: 6.10.3
  • Npm version : 3.10.10
  • I'm behind a corporate proxy

What I did:

I installed vue-cli:

sudo npm install -g vue-cli --no-bin-links

I created a new vue-cli project with the "use sass" option:

vue init webpack-simple my_project_name

I installed dependencies:

cd my_project_name
sudo npm install --no-bin-links

In "package.json" file, I replaced:

"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot"

With:

"dev": "cross-env NODE_ENV=development webpack-dev-server --hot --port 8080 --host 0.0.0.0"

In "node_modules/webpack-dev-server/lib/Server.js" file, I added:

options.watchOptions = {
    aggregateTimeout: 300,
    poll: true
};

I uninstalled sass, then I installed sass again:

npm uninstall node-sass --save-dev
sudo npm install node-sass --save-dev --no-bin-links

Now, I try to start the server:

npm run dev

And I get the following error:

ERROR in ./~/css-loader!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-9ff273a2","scoped":false,"hasInlineConfig":false}!./~/sass-loader/lib/loader.js!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue
Module build failed: Error: /var/www/html/my_project_name/node_modules/node-sass/vendor/linux-x64-48/binding.node: failed to map segment from shared object: Operation not permitted
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at module.exports (/var/www/html/my_project_name/node_modules/node-sass/lib/binding.js:19:10)
    at Object.<anonymous> (/var/www/html/my_project_name/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:570:32)
 @ ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-9ff273a2","scoped":false,"hasInlineConfig":false}!./~/sass-loader/lib/loader.js!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 4:14-317 13:3-17:5 14:22-325
 @ ./src/App.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://0.0.0.0:8080 webpack/hot/dev-server ./src/main.js

For information, everything works fine if I don't activate the "sass" option when I create the project with "vue init".

Does anyone know how to fix it please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions