Skip to content

Commit bcaf246

Browse files
authored
fix: verify no errors during npm install (#132)
The case: - We try to install nativescript-dev-sass@next which is not available. - Before this fix it will fail silently and project will use some old sass plugin version (or even it will hav eno sass plugin and it will fail) - Now we check if npm install is correct - This check may lead to failing tests where we install invalid version, but this will actually make our tests valid.
1 parent bb0d0de commit bcaf246

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/npm/npm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def pack(folder, output_file):
4040
def install(package='', option='', folder=None, log_level=CommandLogLevel.FULL):
4141
if package is None:
4242
raise NameError('Package can not be None.')
43-
return Npm.__run_npm_command('i {0} {1}'.format(package, option), folder=folder, log_level=log_level)
43+
command = 'i {0} {1}'.format(package, option)
44+
output = Npm.__run_npm_command(command, folder=folder, log_level=log_level)
45+
assert "ERR!" not in output, "`npm " + command + "` failed with: \n" + output
4446

4547
@staticmethod
4648
def uninstall(package, option='', folder=None, log_level=CommandLogLevel.FULL):

0 commit comments

Comments
 (0)