Skip to content

Bug: Cannot resolve native dependencies in app/package.json #933

@anthonyraymond

Description

@anthonyraymond

Hi,

Since last release (0.11.0), i can't import modules declared in app/package.json. I changed nothing, and it was working on this commit

It results in the following error

Uncaught Error: Cannot find module 'electron-config'
    at Module._resolveFilename (module.js:470)
    at Function.Module._resolveFilename (T:\ProjetsAutre\archive-notifier\node_modules\electron\dist\resources\electron.asar\common\reset-se…:35)
    at Function.Module._load (module.js:418)
    at Module.require (module.js:498)
    at require (internal/module.js:20)
    at Object.49 (external "electron-config":1)
    at __webpack_require__ (bootstrap 6b881ca…:657)
    at fn (bootstrap 6b881ca…:85)
    at Object../app/actions/settings.js (settings.js:2)
    at __webpack_require__ (bootstrap 6b881ca…:657)

In this case it's electron-config, but i tryed with differents modules. electron-config is installed with yarn.

app/package.json

{
  ...
  "scripts": {
    "postinstall": "npm rebuild --runtime=electron --target=1.6.1 --disturl=https://atom.io/download/atom-shell --build-from-source"
  },
  "license": "MIT",
  "dependencies": {
    "chokidar": "^1.6.1",
    "electron-config": "^0.2.1",
    "node-notifier": "^5.1.2",
    "node-yaml": "^3.0.3"
  }
}

How to reproduce

  1. Clone the project.
  2. app/package.josn
"dependencies": {
  "node-yaml": "^3.0.3"
}
  1. app/index.js
import yaml from 'node-yaml';
  1. yarn install
  2. npm run dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions