Created by: Norris1z
This change prevents Regex expression errors from being thrown when the paths passed to the function has a ++
in them.
Taking a path like some/dummy/path/with++/
the function transforms it to some\/dummy\/path\/with++\/
the second +
is not ignored by the regex engine and hence throws an Invalid Regular Expression Error
This pull request changes the path to some\/dummy\/path\/with\+\+\/
with all +
escaped.
I noticed the bug when i tried to run npm start
in a directory containing a +
in it's name.
npm version 5.5.1
node version 8.9.3
$ npm start
> demoreact@0.1.0 start C:\Users\Norris\Desktop\C_C++\JS\NodeJs\demoreact
> react-scripts start
Invalid regular expression: /^(?!C:\\Users\\Norris\\Desktop\\C_C++\\JS\\NodeJs\\demoreact\\src\\).+[\\/]node_modules[\\/]/: Nothing to repeat
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demoreact@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demoreact@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Changing the path for the project solved the problem.