Closed neojp closed 8 years ago
Windows' directory separators are backslashes like this \, trying to replace /node_modules would end up with 2 node_module directories in the same path failing the conditional.
\
/node_modules
node_module
The original code returned the following path:
C:\Users\neojp\AppData\Roaming\npm\node_modules/node_modules/stylelint/dist/cli.js
Proposed code returns the following:
C:\Users\neojp\AppData\Roaming\npm\node_modules/stylelint/dist/cli.js
By failing the conditional if(cliLocation){ it would attempt to run the else section returning the following error:
if(cliLocation){
Error: Cannot find module 'postcss'
This fix only applies to global packages.
:shipit: :+1:
Windows' directory separators are backslashes like this
\
, trying to replace/node_modules
would end up with 2node_module
directories in the same path failing the conditional.The original code returned the following path:
Proposed code returns the following:
By failing the conditional
if(cliLocation){
it would attempt to run the else section returning the following error:This fix only applies to global packages.