Hi,
I've upgraded npm to the version 3 yesterday, and discovered that the package ain't compatible with that version.
With npm3, all packages and their dependencies are installed in the root node_modules/ folder, so the following lines makes me unable to build the package :
https://github.com/NextStepWebs/simplemde-markdown-editor/blob/1.8.0/package.json#L49-L51
I'm sorry i can't help more by making a pull request, i have just no clue about how to fix this.
Im also getting this error
I'll look into it.
Not running into any errors with npm3. Here's what I'm doing:
git clone https://github.com/NextStepWebs/simplemde-markdown-editor.git
cd simplemde-markdown-editor/
npm install # install all the dependencies
gulp # build the files
Can you list the exact steps and errors you are seeing?
Getting this also, that is:
ERROR in ./~/simplemde/src/js/simplemde.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./node_modules/codemirror-spell-checker/src/js/spell-checker.js in /home/magus/dev/current/nouwiki.js/client/node_modules/simplemde
@ ./~/simplemde/src/js/simplemde.js 12:0-24
This isn't a problem when doing git clone..., npm install and gulp, but it is when I add "simplemde": "^1.8.1", to my package.json, simplemde will look for spell-checker and not find it since there is no ./node_modules/simplemde/node_modules/.
Can you point me to a public repository that does not compile because of SimpleMDE? That way I can do some testing.
Okay, just created a simple repo at https://github.com/01AutoMonkey/npm3-simplemde-bug based on instagrams webpack example.
git clone https://github.com/01AutoMonkey/npm3-simplemde-bug.git
cd npm3-simplemde-bug/example
npm i
webpack -p
Results in:
...
ERROR in ./~/simplemde/src/js/simplemde.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./node_modules/codemirror-spell-checker/src/js/spell-checker.js in /home/magus/dev/current/tmp_git_clones/npm3-simplemde-bug/example/node_modules/simplemde
@ ./~/simplemde/src/js/simplemde.js 11:0-24
As well as some irrelevant warnings.
This appears to have something to do with the fact that codemirror-spell-checker is not published on npm.
Any idea when this will be fixed?
In the future, when work permits enough available time to complete these changes.
Before the spell checker can be published to npm, it'll need to be converted to UMD design. A PR with these changes would speed the process.
Could it be the two lines in package.json under "browser" that specify "./node_modules/" ?
I've run into this error message trying to "require('simplemde')" with webpack. If I edit those two lines gulp still happily resolves them to where npm put them (peers of simplemde's dir rather than the specified descendants) and webpack no longer complains.
To clarify: I see the error when simplemde is a dependency of another project, so it goes into
<root>/node_modules/simplemde/*
Certain tools read simplemde's package.json and resolve the "browser" refs to
<root>/node_modules/simplemde/./node_modules/codemirror-spell-checker/*
which is incorrect because npm put that dependency at
<root>/node_modules/codemirror-spell-checker/*
Removing the ./node_modules/ prefix solves my issue and also works when running gulp to build simplemde in a clean git clone.
I have this NPM3 problem too.
As a temporary solution I removed all spellchecker stuff in my fork so I can build my own project with NPM3 by specifying forked github version of simplemde in my package.json.
Problems are defenitely related to ./node_modules part in browser field of package.json
Walkaround: require simplemde/dist/simplemde.min.js instead of just simplemde.
Or add this string to webpack.config.js:
"simplemde":"simplemde/dist/simplemde.min",
Webpack outputs a warning, but editor works
Can we a get a NPM release for this? ;)
CodeMirror Spell Checker and its dependencies have just been published to NPM. SimpleMDE will reflect this soon. It should fix errors when trying to install it.
Hi, first of all thanks for simplemde.
Unfortunately after updating simplemde in my webpack project to version 1.11.0 I get following error:
ERROR in ./~/typo-js/typo.js
Module not found: Error: Cannot resolve module 'fs' in $PROJECT_PATH/node_modules/typo-js
@ ./~/typo-js/typo.js 164:12-25
$ npm ls typo-js
$PROJECT
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]
For anyone having same issue as mine.
I fixed it by changing webpack configuration:
const webpackConfig = {
// only changed config part:
node: { fs: 'empty' },
plugins: new webpack.ProvidePlugin({ CodeMirror: 'codemirror' })
}
After fixing the 'fs' problem with node: { fs: 'empty' } I faced the 'undefined CodeMirror' issue (https://github.com/NextStepWebs/simplemde-markdown-editor/issues/175). After making CodeMirror globally available with plugins: new webpack.ProvidePlugin({ CodeMirror: 'codemirror' }) everything works.
It's not pretty but I hope it helps.
Most helpful comment
For anyone having same issue as mine.
I fixed it by changing webpack configuration:
After fixing the 'fs' problem with
node: { fs: 'empty' }I faced the 'undefined CodeMirror' issue (https://github.com/NextStepWebs/simplemde-markdown-editor/issues/175). After makingCodeMirrorglobally available withplugins: new webpack.ProvidePlugin({ CodeMirror: 'codemirror' })everything works.It's not pretty but I hope it helps.