Cannot find module 'to-fast-properties'

See original GitHub issue

Babel Configuration (.babelrc, package.json, cli command)

webpack.config.js

const path    = require('path');
const webpack = require('webpack');

module.exports = {
    entry: './src/main.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js',
        publicPath: '/assets',
    },
    devServer: {
        contentBase: path.resolve(__dirname, './src'),
    },
    plugins: [
        new webpack.optimize.UglifyJsPlugin({
            sourceMap: true
        }),
    ],
    module: {
        loaders: [
            {test: /\.js$/, loader: 'babel-loader', exclude: /(\.test.js$|node_modules)/},
            {test: /\.css$/, loader: 'style-loader!css-loader'},
            {test: /\.tpl.html/, loader: 'html-loader'},
            {test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/, loader: 'url-loader?limit=50000'}
        ]
    },
};

package.json

"devDependencies": {
    "angular-mocks": "^1.6.2",
    "awesome-typescript-loader": "^3.0.4",
    "babel-core": "^6.23.1",
    "babel-loader": "^6.3.2",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-es2015": "^6.22.0",
    "babel-register": "^6.23.0",
    "babel-runtime": "^6.23.0",
    "chai": "^3.5.0",
    "chalk": "^1.1.3",
    "clean-webpack-plugin": "^0.1.15",
    "connect": "^3.6.0",
    "cross-env": "^3.1.4",
    "css-loader": "^0.26.1",
    "eslint": "^3.15.0",
    "eslint-config-defaults": "^9.0.0",
    "file-loader": "^0.10.0",
    "gulp": "^3.9.1",
    "gulp-webpack": "^1.5.0",
    "html-loader": "^0.4.4",
    "html-webpack-plugin": "^2.28.0",
    "jasmine-core": "^2.5.2",
    "karma": "^1.4.1",
    "karma-chrome-launcher": "^2.0.0",
    "karma-jasmine": "^1.1.0",
    "karma-mocha-reporter": "^2.2.2",
    "karma-webpack": "^2.0.2",
    "minimist": "^1.2.0",
    "mocha": "^3.2.0",
    "ngtemplate-loader": "^1.3.1",
    "open-browser-webpack-plugin": "0.0.4",
    "serve-static": "^1.11.2",
    "sinon": "^1.17.7",
    "style-loader": "^0.13.1",
    "url-loader": "^0.5.7",
    "webpack": "^2.2.1",
    "webpack-dev-server": "^2.4.1"
  }

Expected Behavior

Webpack/Babel to successfully build my application

Current Behavior

ERROR in ./src/main.js Module build failed: Error: Cannot find module ‘to-fast-properties’ at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object.<anonymous> (/Users/{}/dev/node_modules/babel-types/lib/index.js:311:25) at Module._compile (module.js:571:32) at Object.Module._extensions…js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3)

Context

Any time I try to run webpack with babel-loader it breaks because it cannot find to-fast-modules even though it is in the node_modules directory. I have done everything from npm cache clean && rm -rf node_modules && npm install to removing all globally installed node packages to completely uninstall and reinstalling node itself and still this problem persists.

Your Environment

software version
Babel 6.23.1
node 7.5 (but also 6.9.5)
npm 4.1.2 (but also 3.10.10)
Operating System OSX 10.12.3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
loganfsmythcommented, Feb 21, 2017

Would you be able to zip up an example repo, including node_modules, and post it somewhere I could look at? Also feel free to join our Slack if you want a faster back-and-forth.

0reactions
larryboymicommented, Aug 18, 2017

Right, I updated my npm and it was taken care of. Some other dependency must have drawn this out in a weird way. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module Not Found Node Js 'to-fast-properties' - Stack Overflow
By the I am using react library which I would like to browserify my js code to execute in browser. Is there any...
Read more >
to-fast-properties - npm
Use %HasFastProperties(object) and --allow-natives-syntax to check whether an object already has fast properties. Install. $ npm install to-fast ...
Read more >
Cannot find module 'to-fast-properties' - Babel - Bountysource
Cannot find module 'to-fast-properties' ... Babel Configuration (.babelrc, package.json, cli command). webpack.config.js
Read more >
to-fast-properties - npm Package Health Analysis - Snyk
Is to-fast-properties safe to use? The npm package to-fast-properties was scanned for known vulnerabilities and missing license, and no issues were found. Thus ......
Read more >
Cannot find module 'internal/modules/cjs/loader.js' | bobbyhadz
To solve the error Cannot find module 'internal/modules/cjs/loader.js', make sure you are pointing the node command to a file that exists on your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found