Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

error on save #43

Closed
tomsteg opened this issue Jan 29, 2016 · 10 comments
Closed

error on save #43

tomsteg opened this issue Jan 29, 2016 · 10 comments

Comments

@tomsteg
Copy link

tomsteg commented Jan 29, 2016

when I save a php file with html code in it, I get an error:

Error: Cannot find module 'xregexp'
Error: Cannot find module 'xregexp'
    at Module._resolveFilename (module.js:336:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.parse (/Users/thomassteglich/.atom/packages/linter-php/node_modules/atom-linter/lib/helpers.js:302:15)
    at /Users/thomassteglich/.atom/packages/linter-phpmd/lib/main.coffee:61:26
    at process._tickCallback (node.js:368:9)
@Arcanemagus
Copy link
Member

As reported by another user it sounds like apm is failing to install the dependencies properly, can you try uninstalling the plugin and then installing it again?

@tomsteg
Copy link
Author

tomsteg commented Jan 29, 2016

I uninstalled it and installed it again, but I get the same error.
I added a screenshot of my settings.
2016-01-29_09-43-34

@Arcanemagus
Copy link
Member

Do you have npm installed on your system? If so can you run npm list --depth=0 in the ~/.atom/packages/linter-phpmd folder?

The only reason it should ever be saying that is if it somehow has an out of date atom-linter installed, but got as far in updating it as removing that old dependency.

@tomsteg
Copy link
Author

tomsteg commented Jan 29, 2016

I get the following result:

linter-phpmd@1.4.1 /Users/thomassteglich/.atom/packages/linter-phpmd
├── atom-linter@4.3.4
└── atom-package-deps@3.0.7

@Arcanemagus
Copy link
Member

Hmmm, looks like it's actually loading the module from the linter-php package, can you run npm list (without the depth restriction) in there?

@tomsteg
Copy link
Author

tomsteg commented Jan 29, 2016

Here is the list without restrictions (and error line at the bottom):

linter-phpmd@1.4.1 /Users/thomassteglich/.atom/packages/linter-phpmd
├─┬ atom-linter@4.3.4
│ ├─┬ consistent-path@1.0.3
│ │ └─┬ shell-path@1.0.8
│ │   └─┬ strip-ansi@3.0.0
│ │     └── ansi-regex@2.0.0
│ ├── named-js-regexp@1.3.1
│ └─┬ tmp@0.0.28 invalid
│   └── os-tmpdir@1.0.1
└─┬ atom-package-deps@3.0.7
  └── sb-callsite@1.1.2

npm ERR! invalid: tmp@0.0.28 /Users/thomassteglich/.atom/packages/linter-phpmd/node_modules/atom-linter/node_modules/tmp

@Arcanemagus
Copy link
Member

Run that in ~/.atom/packages/linter-php (not linter-phpmd) 😉

@tomsteg
Copy link
Author

tomsteg commented Jan 29, 2016

Oh, sorry. Here is the list from linter-php:

linter-php@1.1.7 /Users/thomassteglich/.atom/packages/linter-php
├─┬ atom-linter@4.3.4
│ ├─┬ consistent-path@1.0.3
│ │ └─┬ shell-path@1.0.8
│ │   └─┬ strip-ansi@3.0.0
│ │     └── ansi-regex@2.0.0
│ ├── named-js-regexp@1.3.1
│ └─┬ tmp@0.0.28 invalid
│   └── os-tmpdir@1.0.1
└─┬ atom-package-deps@3.0.7
  └── sb-callsite@1.1.2

npm ERR! invalid: tmp@0.0.28 /Users/thomassteglich/.atom/packages/linter-php/node_modules/atom-linter/node_modules/tmp

@tomsteg
Copy link
Author

tomsteg commented Jan 29, 2016

And here is the list from phpcs:

linter-phpcs@1.3.0 /Users/thomassteglich/.atom/packages/linter-phpcs
├─┬ atom-linter@3.4.1
│ ├─┬ tmp@0.0.28 invalid
│ │ └── os-tmpdir@1.0.1
│ └── xregexp@2.0.0
├── atom-package-deps@2.1.3
└─┬ minimatch@3.0.0
  └─┬ brace-expansion@1.1.2
    ├── balanced-match@0.3.0
    └── concat-map@0.0.1

npm ERR! invalid: tmp@0.0.28 /Users/thomassteglich/.atom/packages/linter-phpcs/node_modules/atom-linter/node_modules/tmp

I disabled phpcs, restarted atom, and enabled phpcs again. The error has gone.

@Arcanemagus
Copy link
Member

Looks like a release for linter-phpcs is in order 😉.

I wish Atom would fix the bug that causes issues like this 😦.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants